From be5f70b6692c82346bc9158ca0c3c04f5066b598 Mon Sep 17 00:00:00 2001 From: shankar0123 Date: Mon, 4 May 2026 05:11:23 +0000 Subject: [PATCH] refactor(web): drop unused imports (CodeQL #5 + #10) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two CodeQL js/unused-local-variable alerts in one sweep — both Note severity, both pure dead-import cleanup. Alert #10 (web/src/pages/NotificationsPage.tsx:8): formatDateTime imported but only timeAgo used. Verified via repo-wide grep — formatDateTime appears on the import line only. Drop from the import statement; leave timeAgo in place. Alert #5 (web/src/api/client.test.ts:2): Five unused imports in the test file's import block (the test file imports nearly the full API client surface): - acknowledgeHealthCheck - createPolicy - deleteHealthCheck - getHealthCheckHistory - updateHealthCheck Each appears only on the import line — verified via grep -c. Removing them doesn't change test coverage (the corresponding client functions are exported and exercised in their own tests elsewhere, but the integration covered by client.test.ts doesn't reach them yet). Verified locally: tsc --noEmit: exit 0. grep -c on each removed symbol in its file: 0 occurrences. No behavioral change — pure import-list cleanup. References: https://github.com/certctl-io/certctl/security/code-scanning/10 https://github.com/certctl-io/certctl/security/code-scanning/5 Closes both alerts. --- web/src/api/client.test.ts | 5 ----- web/src/pages/NotificationsPage.tsx | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/web/src/api/client.test.ts b/web/src/api/client.test.ts index 6cbdc9d..1068043 100644 --- a/web/src/api/client.test.ts +++ b/web/src/api/client.test.ts @@ -28,7 +28,6 @@ import { markNotificationRead, getAuditEvents, getPolicies, - createPolicy, updatePolicy, deletePolicy, getPolicyViolations, @@ -99,10 +98,6 @@ import { listHealthChecks, getHealthCheck, createHealthCheck, - updateHealthCheck, - deleteHealthCheck, - getHealthCheckHistory, - acknowledgeHealthCheck, getHealthCheckSummary, } from './client'; diff --git a/web/src/pages/NotificationsPage.tsx b/web/src/pages/NotificationsPage.tsx index 5554eaa..f6add5d 100644 --- a/web/src/pages/NotificationsPage.tsx +++ b/web/src/pages/NotificationsPage.tsx @@ -5,7 +5,7 @@ import { getNotifications, markNotificationRead, requeueNotification } from '../ import PageHeader from '../components/PageHeader'; import StatusBadge from '../components/StatusBadge'; import ErrorState from '../components/ErrorState'; -import { formatDateTime, timeAgo } from '../api/utils'; +import { timeAgo } from '../api/utils'; import type { Notification } from '../api/types'; type ViewMode = 'list' | 'grouped';