From 4f8a5c6e1586aab3e9f989f004998f18684c2a5b Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Tue, 6 Oct 2026 12:58:35 +0200 Subject: [PATCH] fix(sonar): drop useless assignments (javascript:S1854) Co-Authored-By: Claude Sonnet 5.5 --- scripts/qa.mjs | 5 ++--- static/js/ai-backends.js | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/qa.mjs b/scripts/qa.mjs index 939a99e..4df3842 100644 --- a/scripts/qa.mjs +++ b/scripts/qa.mjs @@ -106,12 +106,11 @@ const stages = [ else if (/connection|resolve|network|timed out|ConnectionError/i.test(po) || p.error) notes.push('pip-audit SKIPPED (offline)'); else { bad = true; console.log(tail(p, 20)); notes.push('pip-audit FOUND vulns'); } } else notes.push('pip-audit SKIPPED (tool/requirements missing)'); - let hits; if (have('gitleaks')) { const g = sh('gitleaks', ['detect', '--no-banner', '--redact', '--source', '.']); - hits = g.status === 0 ? 0 : -1; notes.push(g.status === 0 ? 'gitleaks ok' : 'gitleaks FOUND'); + notes.push(g.status === 0 ? 'gitleaks ok' : 'gitleaks FOUND'); if (g.status) bad = true; - } else { hits = secretScan(); notes.push(hits ? `secret-scan ${hits} hit(s)` : 'secret-scan ok (built-in regex)'); if (hits) bad = true; } + } else { const hits = secretScan(); notes.push(hits ? `secret-scan ${hits} hit(s)` : 'secret-scan ok (built-in regex)'); if (hits) bad = true; } return { status: bad ? 'FAIL' : 'PASS', note: notes.join('; ') }; }], ['build', 'minify + bundle freshness', () => { diff --git a/static/js/ai-backends.js b/static/js/ai-backends.js index ef5d089..59cced3 100644 --- a/static/js/ai-backends.js +++ b/static/js/ai-backends.js @@ -211,8 +211,6 @@ // ── "Use as STT / TTS" quick-apply buttons in AI Backends section ────────── async function applyAndSaveSettings(patch) { try { - const resp = await fetch('/api/settings').then(r => r.json()); - const updated = { ...resp, ...patch }; await fetch('/api/settings', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(patch) }); if (_appSettings) { const visiblePatch = { ...patch };