From d42784be8cb98562be24bb577f981a14f0cec9ee Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 10 May 2018 15:22:00 +0200 Subject: [PATCH] Address codacy issues Signed-off-by: DL6ER --- scripts/pi-hole/js/index.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index 0fd513c4..18f23724 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -535,8 +535,8 @@ function updateTopClientsChart() { // Clear tables before filling them with data $("#client-frequency td").parent().remove(); - var clienttable = $("#client-frequency").find("tbody:last"); - var client, percentage, clientname, clientip; + var clienttable = $("#client-frequency").find("tbody:last"); + var client, percentage, clientname, clientip, idx; for (client in data.top_sources) { if ({}.hasOwnProperty.call(data.top_sources, client)){ @@ -549,7 +549,7 @@ function updateTopClientsChart() { client = escapeHtml(client); if(client.indexOf("|") > -1) { - var idx = client.indexOf("|"); + idx = client.indexOf("|"); clientname = client.substr(0, idx); clientip = client.substr(idx+1, client.length-idx); } @@ -569,8 +569,7 @@ function updateTopClientsChart() { // Clear tables before filling them with data $("#client-frequency-blocked td").parent().remove(); - var clientblockedtable = $("#client-frequency-blocked").find("tbody:last"); - var client, percentage, clientname, clientip; + var clientblockedtable = $("#client-frequency-blocked").find("tbody:last"); for (client in data.top_sources_blocked) { if ({}.hasOwnProperty.call(data.top_sources_blocked, client)){ @@ -583,7 +582,7 @@ function updateTopClientsChart() { client = escapeHtml(client); if(client.indexOf("|") > -1) { - var idx = client.indexOf("|"); + idx = client.indexOf("|"); clientname = client.substr(0, idx); clientip = client.substr(idx+1, client.length-idx); }