From 83238c2b0fedde95a79d2ef810e3df0cb9ce7c91 Mon Sep 17 00:00:00 2001 From: j-w9 <295470691+j-w9@users.noreply.github.com> Date: Sun, 11 Oct 2026 20:54:27 +0200 Subject: [PATCH 1/4] SysID: declare variables that were implicitly global Each was assigned without let/var, creating a global, but is only used within the function (or loop) that assigns it, and is not used by any other script on the page, so let does not change behaviour. --- SysID/SysID.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SysID/SysID.js b/SysID/SysID.js index 0e819e1b..545d7ec9 100644 --- a/SysID/SysID.js +++ b/SysID/SysID.js @@ -416,7 +416,7 @@ async function run_transfer_function_ID(parser) { const ind2_i = nearestIndex(timeData_arr, t_end*1000000) console.log("ind1: ",ind1_i," ind2: ",ind2_i) - timeData = Array.from(timeData_arr) + let timeData = Array.from(timeData_arr) console.log("time field pre slicing size: ", timeData.length) timeData = timeData.slice(ind1_i, ind2_i) @@ -453,7 +453,7 @@ async function run_transfer_function_ID(parser) { mult = parseFloat(outputValues.multipliers[0]) } let ang_data = parser.get("ATT", outputValues.compensations[0]) - ang_data_arr = Array.from(ang_data) + let ang_data_arr = Array.from(ang_data) ang_data_arr.slice(att_ind1, att_ind2) console.log("data field ", outputValues.compensations[0], " pre slicing size: ", outputData.length) const G = 9.81 @@ -677,7 +677,7 @@ async function run_SS_ID(parser) { const ind2_i = nearestIndex(timeData_arr, t_end_ss*1000000) console.log("ind1: ",ind1_i," ind2: ",ind2_i) - timeData = Array.from(timeData_arr) + let timeData = Array.from(timeData_arr) console.log("time field pre slicing size: ",timeData.length) timeData = timeData.slice(ind1_i, ind2_i) @@ -718,19 +718,19 @@ async function run_SS_ID(parser) { mult = parseFloat(outputValues.multipliers[i]) } let ang_data = parser.get("ATT", outputValues.compensations[i]) - ang_data_arr = Array.from(ang_data) + let ang_data_arr = Array.from(ang_data) ang_data_arr.slice(att_ind1, att_ind2) console.log("data field ", outputValues.compensations[i], " pre slicing size: ", data_arr.length) const G = 9.81 if (outputValues.compensations[i] == "Roll") { for (let j = 0; j < data_arr.length; j++) { - temp_data = data_arr[j] + let temp_data = data_arr[j] data_arr[j] = data_arr[j] + (Math.PI/180) * mult * G * ang_data_arr[att_ind1 + j] } } if (outputValues.compensations[i] == "Pitch") { for (let j = 0; j < data_arr.length; j++) { - temp_data = data_arr[j] + let temp_data = data_arr[j] data_arr[j] = data_arr[j] - (Math.PI/180) * mult * G * ang_data_arr[att_ind1 + j] } } From 08d27484df125620d17dd6a751c5fcfee15e6833 Mon Sep 17 00:00:00 2001 From: j-w9 <295470691+j-w9@users.noreply.github.com> Date: Sun, 11 Oct 2026 20:54:27 +0200 Subject: [PATCH 2/4] SysID: declare the matrix-filling variables in each function rows, cols, cellSelector and inputElement were implicit globals shared by setMatrixA, setMatrixB, setH0 and setH1. Each function assigns them before reading them and none calls another, so declaring them locally does not change behaviour. --- SysID/index.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SysID/index.html b/SysID/index.html index 9e00eb61..8340279e 100644 --- a/SysID/index.html +++ b/SysID/index.html @@ -593,6 +593,7 @@

Flight Data

} function setMatrixA(vehicle_axis) { + let rows, cols, cellSelector, inputElement if (vehicle_axis == "MR_Roll" || vehicle_axis == "MR_Pitch") { rows = 4; cols = 4; @@ -691,6 +692,7 @@

Flight Data

} function setMatrixB(vehicle_axis) { + let rows, cols, cellSelector, inputElement if (vehicle_axis == "MR_Roll" || vehicle_axis == "MR_Pitch") { rows = 4; cols = 1; @@ -723,6 +725,7 @@

Flight Data

} function setH0(vehicle_axis) { + let rows, cols, cellSelector, inputElement if (vehicle_axis == "MR_Roll" || vehicle_axis == "MR_Pitch") { rows = 2; cols = 4; @@ -757,6 +760,7 @@

Flight Data

} function setH1(vehicle_axis) { + let rows, cols, cellSelector, inputElement if (vehicle_axis == "MR_Roll" || vehicle_axis == "MR_Pitch") { rows = 2; cols = 4; From 4e56ce521338941c9f1e365ba961ab4824378021 Mon Sep 17 00:00:00 2001 From: j-w9 <295470691+j-w9@users.noreply.github.com> Date: Sun, 11 Oct 2026 20:54:27 +0200 Subject: [PATCH 3/4] SysID: remove variables that are assigned but never read dbl and triple in the notch filters, and temp_data in SysID's compensation loops, were implicit globals that nothing read; declaring them only made them unused locals. Drop them and prune their suppressions. --- SysID/SysID.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/SysID/SysID.js b/SysID/SysID.js index 545d7ec9..47ac9bcf 100644 --- a/SysID/SysID.js +++ b/SysID/SysID.js @@ -724,13 +724,11 @@ async function run_SS_ID(parser) { const G = 9.81 if (outputValues.compensations[i] == "Roll") { for (let j = 0; j < data_arr.length; j++) { - let temp_data = data_arr[j] data_arr[j] = data_arr[j] + (Math.PI/180) * mult * G * ang_data_arr[att_ind1 + j] } } if (outputValues.compensations[i] == "Pitch") { for (let j = 0; j < data_arr.length; j++) { - let temp_data = data_arr[j] data_arr[j] = data_arr[j] - (Math.PI/180) * mult * G * ang_data_arr[att_ind1 + j] } } From 0708bb1d90c3364b1360870484ee84ed726d7458 Mon Sep 17 00:00:00 2001 From: j-w9 <295470691+j-w9@users.noreply.github.com> Date: Sun, 11 Oct 2026 20:54:29 +0200 Subject: [PATCH 4/4] SysID: prune fixed ESLint suppressions --- eslint-suppressions.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/eslint-suppressions.json b/eslint-suppressions.json index d509b65e..f7d18107 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -123,13 +123,10 @@ }, "SysID/SysID.js": { "no-undef": { - "count": 27 + "count": 3 } }, "SysID/index.html": { - "no-undef": { - "count": 132 - }, "no-unused-vars": { "count": 1 }