Dead code and unused exports eliminated
Why it matters
Commented-out code blocks and abandoned files (api-old.ts, utils.backup.ts) create ambiguity about which implementation is authoritative and inflate the mental model required to understand the codebase. ISO 25010:2011 §6.5.2 classifies this as a maintainability defect. For AI-built projects, the risk is compounded: a new coding session may incorrectly treat the abandoned code as the canonical version and reintroduce bugs that were already fixed in the active implementation.
Severity rationale
Low because dead code does not cause runtime failures but creates maintenance overhead and, in AI-assisted workflows, risks reintroducing previously fixed bugs from the abandoned version.
Remediation
Delete dead code — version control history preserves it if you ever need it back. Enable TypeScript compiler flags to catch unused variables and parameters automatically:
{
"compilerOptions": {
"noUnusedLocals": true,
"noUnusedParameters": true
}
}
For unused exports across the entire project, run:
npx ts-unused-exports tsconfig.json
For commented-out code blocks, configure an ESLint rule or use a pre-commit hook that flags multi-line comment blocks containing what looks like executable code.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Code Quality Essentials Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · maintainability.analysability — Maintainability — Analysability
Taxons
History
- 2026-04-18·v1.0.0·Initial import from code-quality-essentials·automated