No commented-out code blocks
Why it matters
Commented-out code blocks leave the reader uncertain about whether the code represents a previous implementation, a planned alternative, or a debugging remnant. That uncertainty slows every code review. ISO 25010 maintainability.analysability degrades: developers must read and evaluate code that does nothing. Files with large blocks of commented code are harder to grep and diff, and they create review fatigue that causes reviewers to miss real issues. If the code is needed, it belongs in a branch. If it is not needed, git history already preserves it.
Severity rationale
Low because commented-out code creates cognitive overhead and clutters diffs, but does not affect runtime behavior or security directly.
Remediation
Delete commented-out code blocks and rely on git history for recovery:
# Find large comment blocks (heuristic)
grep -r "^[[:space:]]*//' src/ | grep -v "eslint\|@\|TODO\|FIXME\|http" | head -50
Commit each removal with a message describing what was deleted: remove commented-out legacy auth implementation. If recovery is needed later, git log -S 'deletedFunctionName' finds the commit. Use feature branches for in-progress alternatives instead of comment blocks.
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 Maintainability Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · maintainability.analysability — Analysability
Taxons
History
- 2026-04-18·v1.0.0·Initial import from code-maintainability·automated