From 439905e546cf5cc49790ba14d60f80d012974141 Mon Sep 17 00:00:00 2001 From: shankar0123 Date: Mon, 4 May 2026 05:10:04 +0000 Subject: [PATCH] refactor(scep-gui): remove unused pickTabFromQuery (CodeQL #22) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CodeQL alert #22 (js/unused-local-variable, severity: Note) flagged pickTabFromQuery at web/src/pages/SCEPAdminPage.tsx:584 as dead code. Audit: this function is a leftover from an incomplete refactor. The SCEP admin page picks its initial tab via pickInitialTab (line 594 post-edit), which subsumes the same query-string check that pickTabFromQuery did: pickInitialTab honors three signals (precedence high → low): 1. ?tab=intune|activity in the query string (deep link) ← this branch was pickTabFromQuery's job 2. Pathname ending in /scep/intune (legacy alias from Phase 9.4) 3. Default to 'profiles' pickTabFromQuery only handled signal (1); pickInitialTab inlined the same logic on its first branch and added (2) + (3). Nothing references pickTabFromQuery (verified via repo-wide grep). Pure dead code. Fix: delete the function. No behavioral change — pickInitialTab already does the work. Verified locally: tsc --noEmit: exit 0. grep -nE 'pickTabFromQuery' web/src/: zero references. Reference: https://github.com/certctl-io/certctl/security/code-scanning/22 Closes CodeQL alert #22 (js/unused-local-variable). --- web/src/pages/SCEPAdminPage.tsx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/web/src/pages/SCEPAdminPage.tsx b/web/src/pages/SCEPAdminPage.tsx index ceb7dc4..aeaa280 100644 --- a/web/src/pages/SCEPAdminPage.tsx +++ b/web/src/pages/SCEPAdminPage.tsx @@ -581,11 +581,6 @@ function RecentEventsTable({ events, testID, emptyMessage }: RecentEventsTablePr // Top-level page. // ============================================================================= -function pickTabFromQuery(value: string | null): TabId { - if (value === 'intune' || value === 'activity') return value; - return 'profiles'; -} - // pickInitialTab honors three signals (precedence high → low): // 1. ?tab=intune|activity in the query string (deep link) // 2. Pathname ending in /scep/intune (legacy route alias from