MapnosticsDOCS
← Back to Main Site
DocsIntelligence ModulesDead Code Detection
🔍

Dead Code Detection

Mapnostics scans every file and flags exports, functions, classes, and entire files that are never referenced anywhere. Each flag includes a confidence score so you know exactly what is safe to delete.

What is dead code

Dead code is any code that exists in your repository but is never executed at runtime. It accumulates over years of feature flags, refactors, and abandoned experiments. Left untouched, it misleads engineers, inflates bundle sizes, and introduces hidden risk.

NOTE
Dead code is not the same as zombie code. Dead code is never called. Zombie code is called but produces stale or unused outputs. Mapnostics detects both separately.

Live demo

Watch Mapnostics scan a repository and surface dead code flags in real time. The scan bar shows progress — each flag appears as it is confirmed with a confidence score.

mapnostics.com/repo/mapnostics-app/dead-code
Dead Code Detection
mapnostics-app · last scan 2 min ago · 312 files indexed
0
Total Flags
0
Reviewed
95%+
Confidence
SCANNING…
0%
src/utils/legacy-format.ts · L12–14100% confident
Unused export: formatDateLegacy
export
src/components/old-table/index.ts · L498% confident
Unused export: OldTableExport
export
src/hooks/useDeprecated.ts · L895% confident
Function declared but never called
function
src/pages/Beta.tsx · L1–112100% confident
Entire file — no inbound imports found
file
src/middleware/old-auth.ts · L697% confident
Exported class never instantiated
class

Reading the results

Confidence score

Confidence is calculated by checking whether the export or function is referenced anywhere — direct imports, dynamic requires, re-exports, and barrel files. A 100% score means zero references were found across the entire codebase.

Flag types

  • export — a named or default export that no other file imports.
  • function — a declared function that is never called.
  • class — a class definition that is never instantiated or extended.
  • file — the entire file has zero inbound imports anywhere in the repo.

What to do next

  • Run the Impact Simulator on a flagged file to confirm it has zero dependents before deleting.
  • Mark items as "confirmed dead" and track cleanup progress over time.
  • Start with 100% confidence flags — safe to delete immediately.
  • Share the report link with a tech lead for async review.
TIP
Teams that delete dead code in their first week see an average health score improvement of 8–12 points.