Codebase Health Score
A single number from 0โ100 reflecting the current state of your codebase across six dimensions: dead code, zombie code, file size, test coverage, secrets exposure, and duplicate code. Updated after every re-index.
How scoring works
The base score starts at 100 and points are deducted for each detected issue. Deductions are weighted by severity โ a high dead code ratio costs more than a few oversized files.
- 80โ100 Healthy โ low debt, safe to move fast.
- 60โ79 Moderate โ some debt accumulation, worth a cleanup sprint.
- 40โ59 At Risk โ significant issues, refactors may break things.
- 0โ39 Critical โ high technical debt, unpredictable blast radius.
Live demo
Watch the score count up from zero as Mapnostics tallies each dimension. Bar widths animate to show the severity of each issue โ the ring updates color as the score stabilises.
Score breakdown
Dead Code Ratio
Percentage of files containing at least one dead export or function. A ratio above 20% typically costs 7โ10 points.
Test Coverage
A static estimate: the share of source files that have a matching test file (*.test.*, *.spec.*, or a __tests__ sibling). Mapnostics never runs your test suite, so this is a structural proxy for coverage, not statement coverage.
Secrets Exposure
Any hardcoded API key, password, or token found in the repository deducts points, weighted by severity โ critical costs the most, capped so a noisy scan can't sink the whole score.
Duplicate Code
Each indexed chunk is hashed by its normalized content; chunks whose hash appears across two or more files are counted as duplicated. The score deducts in proportion to the duplicated share of the codebase.
Improving your score
- Start with dead code โ delete confirmed-dead files, then re-index.
- Fix the highest-confidence secrets first.
- Split files over 300 lines into focused modules.
- Add tests for the files with the highest blast radius (use the Impact Simulator to find them).