From ff6ffcda1b82ec5d7af41c10188986b0bc16cec9 Mon Sep 17 00:00:00 2001 From: shankar0123 Date: Mon, 4 May 2026 05:31:17 +0000 Subject: [PATCH] refactor(web): drop 5 unused imports across 4 pages (CodeQL #6, #7, #8, #9) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Four CodeQL js/unused-local-variable alerts in one sweep — all Note severity, all pure dead-import cleanup verified by grep (each removed symbol had exactly 1 occurrence in its file: the import line itself). Alert #6 — web/src/pages/AgentFleetPage.tsx:3: Drop Legend from recharts named-import list. The fleet pie chart renders without a legend (the slice colors are labeled inline via Tooltip). Alert #7 — web/src/pages/DashboardPage.tsx:9: Drop getAgents + getNotifications from the api/client named- import list. The dashboard summary card now uses getDashboardSummary (single endpoint) instead of fanning out to per-resource list calls; the agents + notifications full list is reachable via dedicated pages. Alert #8 — web/src/pages/CertificatesPage.tsx:6: Drop revokeCertificate from the api/client named-import list. The page uses bulkRevokeCertificates for the multi-cert UX; single-cert revoke happens on CertificateDetailPage which imports revokeCertificate independently. Alert #9 — web/src/pages/DiscoveryPage.tsx:15: Drop the StatusBadge default-import line. Discovered-cert status renders inline (text label colored via the row's state-class) without the StatusBadge component. Verified locally: Each flagged symbol: 0 occurrences in its file post-edit. tsc --noEmit: exit 0. No behavioral change — pure import-list cleanup. References: https://github.com/certctl-io/certctl/security/code-scanning/6 https://github.com/certctl-io/certctl/security/code-scanning/7 https://github.com/certctl-io/certctl/security/code-scanning/8 https://github.com/certctl-io/certctl/security/code-scanning/9 Closes all four alerts. --- web/src/pages/AgentFleetPage.tsx | 2 +- web/src/pages/CertificatesPage.tsx | 2 +- web/src/pages/DashboardPage.tsx | 2 +- web/src/pages/DiscoveryPage.tsx | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/web/src/pages/AgentFleetPage.tsx b/web/src/pages/AgentFleetPage.tsx index 11540df..8118919 100644 --- a/web/src/pages/AgentFleetPage.tsx +++ b/web/src/pages/AgentFleetPage.tsx @@ -1,6 +1,6 @@ import { useQuery } from '@tanstack/react-query'; import { useNavigate } from 'react-router-dom'; -import { PieChart, Pie, Cell, ResponsiveContainer, Tooltip, Legend } from 'recharts'; +import { PieChart, Pie, Cell, ResponsiveContainer, Tooltip } from 'recharts'; import { getAgents } from '../api/client'; import PageHeader from '../components/PageHeader'; import StatusBadge from '../components/StatusBadge'; diff --git a/web/src/pages/CertificatesPage.tsx b/web/src/pages/CertificatesPage.tsx index 8818e70..273311a 100644 --- a/web/src/pages/CertificatesPage.tsx +++ b/web/src/pages/CertificatesPage.tsx @@ -3,7 +3,7 @@ import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useTrackedMutation } from '../hooks/useTrackedMutation'; import { useListParams } from '../hooks/useListParams'; import { useNavigate } from 'react-router-dom'; -import { getCertificates, createCertificate, revokeCertificate, getOwners, getTeams, getRenewalPolicies, getProfiles, getIssuers, bulkRevokeCertificates, bulkRenewCertificates, bulkReassignCertificates } from '../api/client'; +import { getCertificates, createCertificate, getOwners, getTeams, getRenewalPolicies, getProfiles, getIssuers, bulkRevokeCertificates, bulkRenewCertificates, bulkReassignCertificates } from '../api/client'; import { useAuth } from '../components/AuthProvider'; import { REVOCATION_REASONS } from '../api/types'; import PageHeader from '../components/PageHeader'; diff --git a/web/src/pages/DashboardPage.tsx b/web/src/pages/DashboardPage.tsx index 6632729..f18c21c 100644 --- a/web/src/pages/DashboardPage.tsx +++ b/web/src/pages/DashboardPage.tsx @@ -7,7 +7,7 @@ import { XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend, } from 'recharts'; import { - getCertificates, getAgents, getJobs, getNotifications, getHealth, + getCertificates, getJobs, getHealth, getDashboardSummary, getCertificatesByStatus, getExpirationTimeline, getJobTrends, getIssuanceRate, previewDigest, sendDigest, getIssuers, } from '../api/client'; diff --git a/web/src/pages/DiscoveryPage.tsx b/web/src/pages/DiscoveryPage.tsx index 012db88..eea92e3 100644 --- a/web/src/pages/DiscoveryPage.tsx +++ b/web/src/pages/DiscoveryPage.tsx @@ -12,7 +12,6 @@ import { import PageHeader from '../components/PageHeader'; import DataTable from '../components/DataTable'; import type { Column } from '../components/DataTable'; -import StatusBadge from '../components/StatusBadge'; import ErrorState from '../components/ErrorState'; import { formatDateTime } from '../api/utils'; import type { DiscoveredCertificate, DiscoveryScan } from '../api/types';