MapnosticsDOCS
โ† Back to Main Site
Docsโ€บIntelligence Modulesโ€บHealth Score
๐Ÿ“Š

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.

mapnostics.com/repo/mapnostics-app/health-score
Codebase Health Score
mapnostics-app ยท updated 2 min ago ยท 6 dimensions
AT RISK
0/100
AT RISK
DEBT ESTIMATE
~23โ€“46h
SCORE BREAKDOWN
Dead Code Ratio-7pts
Zombie Codeยฑ0pts
Avg File Size-2pts
Test Coverage-10pts
Secrets Exposure-1pts
Duplicate Code-3pts

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.

NOTE
The health score is always a snapshot. Improvements are reflected the next time Mapnostics re-indexes (daily on Autopilot, or manually triggered).

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).
TIP
Autopilot keeps the score honest: with daily re-indexing, cleanups show up in the score the morning after they merge instead of whenever someone remembers to re-analyze.