Fix Codacy warnings

Run standardjs across all js files, fix all other issues by hand
This commit is contained in:
Sean DuBois
2019-02-05 14:21:11 -08:00
parent 88b495c7f5
commit d9ba0533f5
8 changed files with 16 additions and 22 deletions

View File

@@ -9,7 +9,6 @@ fi
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
CONTRIBUTORS=()
EXCLUDED_CONTIBUTORS=('John R. Bradley') EXCLUDED_CONTIBUTORS=('John R. Bradley')
MISSING_CONTIBUTORS=() MISSING_CONTIBUTORS=()

View File

@@ -18,12 +18,12 @@ window.createDataChannel = name => {
log(`${fullName}: has opened`) log(`${fullName}: has opened`)
dc.onmessage = e => log(`${fullName}: '${e.data}'`) dc.onmessage = e => log(`${fullName}: '${e.data}'`)
let ul = document.getElementById("ul-open"); let ul = document.getElementById('ul-open')
let li = document.createElement('li'); let li = document.createElement('li')
li.appendChild(document.createTextNode(`${fullName}: `)) li.appendChild(document.createTextNode(`${fullName}: `))
let btnSend = document.createElement("BUTTON") let btnSend = document.createElement('BUTTON')
btnSend.appendChild(document.createTextNode("Send message")) btnSend.appendChild(document.createTextNode('Send message'))
btnSend.onclick = () => { btnSend.onclick = () => {
let message = document.getElementById('message').value let message = document.getElementById('message').value
if (message === '') { if (message === '') {
@@ -34,8 +34,8 @@ window.createDataChannel = name => {
} }
li.appendChild(btnSend) li.appendChild(btnSend)
let btnClose = document.createElement("BUTTON") let btnClose = document.createElement('BUTTON')
btnClose.appendChild(document.createTextNode("Close")) btnClose.appendChild(document.createTextNode('Close'))
btnClose.onclick = () => { btnClose.onclick = () => {
dc.close() dc.close()
ul.removeChild(li) ul.removeChild(li)
@@ -47,12 +47,10 @@ window.createDataChannel = name => {
ul.removeChild(li) ul.removeChild(li)
} }
ul.appendChild(li); ul.appendChild(li)
} }
} }
let sendChannel = window.createDataChannel('foo')
pc.oniceconnectionstatechange = e => log(`ICE state: ${pc.iceConnectionState}`) pc.oniceconnectionstatechange = e => log(`ICE state: ${pc.iceConnectionState}`)
pc.onicecandidate = event => { pc.onicecandidate = event => {
if (event.candidate === null) { if (event.candidate === null) {
@@ -63,7 +61,6 @@ pc.onicecandidate = event => {
pc.onnegotiationneeded = e => pc.onnegotiationneeded = e =>
pc.createOffer().then(d => pc.setLocalDescription(d)).catch(log) pc.createOffer().then(d => pc.setLocalDescription(d)).catch(log)
window.startSession = () => { window.startSession = () => {
let sd = document.getElementById('remoteSessionDescription').value let sd = document.getElementById('remoteSessionDescription').value
if (sd === '') { if (sd === '') {

View File

@@ -11,7 +11,7 @@ var log = msg => {
document.getElementById('logs').innerHTML += msg + '<br>' document.getElementById('logs').innerHTML += msg + '<br>'
} }
navigator.mediaDevices.getUserMedia({video: true, audio: true}) navigator.mediaDevices.getUserMedia({ video: true, audio: true })
.then(stream => pc.addStream(document.getElementById('video1').srcObject = stream)) .then(stream => pc.addStream(document.getElementById('video1').srcObject = stream))
.catch(log) .catch(log)

View File

@@ -27,7 +27,7 @@ pc.onicecandidate = event => {
} }
} }
pc.createOffer({offerToReceiveVideo: true, offerToReceiveAudio: true}).then(d => pc.setLocalDescription(d)).catch(log) pc.createOffer({ offerToReceiveVideo: true, offerToReceiveAudio: true }).then(d => pc.setLocalDescription(d)).catch(log)
window.startSession = () => { window.startSession = () => {
let sd = document.getElementById('remoteSessionDescription').value let sd = document.getElementById('remoteSessionDescription').value

View File

@@ -11,7 +11,7 @@ var log = msg => {
document.getElementById('logs').innerHTML += msg + '<br>' document.getElementById('logs').innerHTML += msg + '<br>'
} }
navigator.mediaDevices.getUserMedia({video: true, audio: true}) navigator.mediaDevices.getUserMedia({ video: true, audio: true })
.then(stream => pc.addStream(document.getElementById('video1').srcObject = stream)) .then(stream => pc.addStream(document.getElementById('video1').srcObject = stream))
.catch(log) .catch(log)

View File

@@ -19,7 +19,7 @@ window.createSession = isPublisher => {
} }
if (isPublisher) { if (isPublisher) {
navigator.mediaDevices.getUserMedia({video: true, audio: false}) navigator.mediaDevices.getUserMedia({ video: true, audio: false })
.then(stream => pc.addStream(document.getElementById('video1').srcObject = stream)) .then(stream => pc.addStream(document.getElementById('video1').srcObject = stream))
.catch(log) .catch(log)
pc.onnegotiationneeded = e => { pc.onnegotiationneeded = e => {
@@ -28,7 +28,7 @@ window.createSession = isPublisher => {
.catch(log) .catch(log)
} }
} else { } else {
pc.createOffer({offerToReceiveVideo: true}) pc.createOffer({ offerToReceiveVideo: true })
.then(d => pc.setLocalDescription(d)) .then(d => pc.setLocalDescription(d))
.catch(log) .catch(log)

View File

@@ -27,7 +27,6 @@ static gboolean gstreamer_receive_bus_call(GstBus *bus, GstMessage *msg, gpointe
g_printerr("Error: %s\n", error->message); g_printerr("Error: %s\n", error->message);
g_error_free(error); g_error_free(error);
exit(1); exit(1);
break;
} }
default: default:
break; break;

View File

@@ -31,7 +31,6 @@ static gboolean gstreamer_send_bus_call(GstBus *bus, GstMessage *msg, gpointer d
g_printerr("Error: %s\n", error->message); g_printerr("Error: %s\n", error->message);
g_error_free(error); g_error_free(error);
exit(1); exit(1);
break;
} }
default: default:
break; break;
@@ -71,7 +70,7 @@ void gstreamer_send_start_pipeline(GstElement *pipeline, int pipelineId) {
s->pipelineId = pipelineId; s->pipelineId = pipelineId;
GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline)); GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
guint bus_watch_id = gst_bus_add_watch(bus, gstreamer_send_bus_call, NULL); gst_bus_add_watch(bus, gstreamer_send_bus_call, NULL);
gst_object_unref(bus); gst_object_unref(bus);
GstElement *appsink = gst_bin_get_by_name(GST_BIN(pipeline), "appsink"); GstElement *appsink = gst_bin_get_by_name(GST_BIN(pipeline), "appsink");