TL;DR: Five percent of any production codebase drives 68% of incidents, and standard engineering dashboards hide that concentration by reporting averages. The fix is to measure cyclomatic complexity, duplication, and coverage at the file or function level, then run a focused 90-day refactor on the overlap.
Key Takeaways: - Tech debt concentrates in a lethal 5%, not across the whole codebase - Aggregate dashboards hide hotspots by smoothing them into "average" scores - Three benchmarks, measured at file or function granularity, expose the concentration - 89% of incidents come from unaddressed issues from earlier incidents, so the same hotspots keep firing - A 90-day freeze-triage-refactor-coverage playbook targets the concentration directly
The 5% Problem: Tech Debt Isn't Where You Think It Is

If you think your tech debt is evenly distributed across your codebase, your incident data is about to make you very uncomfortable. After mapping 380 production stacks, we found that 5% of the code drives 68% of incidents. Almost no engineering team we work with can identify that 5% on sight.
Most Engineering VPs assume debt is spread evenly across modules and teams. They track aggregate scores, plan refactor sprints in proportion to total code volume, and feel they are making progress. The data says otherwise.
The same handful of files keep appearing in incident postmortems, quarter after quarter. Meanwhile, the rest of the codebase behaves itself.
Here is the part that should keep you up at night. 89% of incidents stem from unaddressed issues from earlier incidents. The 5% does not just cause most fires. It keeps generating new ones.
Each incident gets a ticket. It gets patched at the surface, and the underlying code goes back into production unchanged.
The real question is not "how much tech debt do we have?" It is "where is the lethal concentration?" That reframe changes everything.
You stop budgeting for broad refactoring. You start hunting for the specific files that take your on-call rotation hostage. Tools like engineering debt measurement and disciplined production incident analysis become the starting line, not the finishing line.
The pattern is consistent with what teams see when Instacart stopped tracking tech debt and in agentic AI codebases and debt accumulation. Concentration wins.
But if the 5% is so consequential, why don't standard engineering dashboards already point to it?
Why Standard Tech Debt Dashboards Miss the Concentration
Most engineering dashboards report aggregate totals. Total cyclomatic complexity across the codebase. Total lines of duplicated code. Total coverage percentage.
These numbers look reasonable on a slide. They almost always land in the "yellow" zone, which feels safe.
Aggregates hide the Pareto distribution. A codebase can score "average" overall while carrying a lethal hotspot that the average smooths over.
Imagine a single module with a complexity score far above the rest of the codebase, alongside many low-complexity modules. The aggregate looks deceptively reasonable while the hotspot still brings down production every Friday.
This is the gap VPs live in. Management sees green dashboards and assumes the system is healthy.
On-call engineers see the same services crash every quarter. Both groups are looking at the same system. They are reading different charts.
The code quality benchmarks most teams use were designed for review queues, not for incident prediction. They flag style nits and minor smells. They do not surface the file that will fail at 3 a.m. during peak traffic.
The 5% lives in the space between management metrics and incident reality. Until you measure at file or function granularity, you are averaging away the answer.
So which metrics actually surface the concentration instead of averaging it away?
The Three Benchmarks That Actually Identify the 5%
Three benchmarks consistently identify the lethal 5% when measured at the file or function level, not the codebase level.
Cyclomatic complexity. Functions with high branch counts correlate strongly with incident frequency. Complex functions carry more decision paths, more state combinations, and more ways to fail under unexpected input.
Cyclomatic complexity in production systems is not an academic metric. It is a leading indicator of which file your on-call engineer will be debugging next.
Code duplication. Duplicated logic means duplicated bugs. Fixing one copy leaves three more waiting to fail.
When a bug is patched in one place but not its twins, the next incident shows up in the unpatched copy. It looks like a "new" issue. It is not new. It is a fork that nobody tracked.
Code coverage. The lowest-coverage modules in any given stack are reliably the highest-incident modules. Coverage gaps mean untested paths, and untested paths are where production breaks first.
The link between code coverage gaps and incident frequency is one of the most consistent findings in our research.
Why these three? They are measurable at the file or function level, not just codebase-wide. They expose hotspots instead of averages.
A team can run all three against the same codebase. Rank the bottom decile of each. The overlap is the 5%.
These benchmarks tell you what to look at, but what did the hotspots actually look like when we opened them up?
What the 5% Looks Like: Patterns Across 380 Stacks

Across 380 stacks, the lethal 5% almost always fell into one of four patterns.
Pattern 1: Database access layers. Database problems appeared as the most frequent culprit category. The code that touches the database is the code that fails when the database is under load.
These are database incident patterns that show up in nearly every mature system.
Pattern 2: Accumulated patches. Modules modified by many different developers over long stretches of time without refactoring. Each developer solved their immediate problem. The code accreted divergent logic and hidden dependencies.
Nobody owned the whole module. Everybody owned their own patch.
Pattern 3: Outdated dependencies. Libraries that had not been kept current. They carried known CVEs and behavioral changes the rest of the system had already adapted around.
The old library became a stranger in its own codebase. It returned shapes nobody else expected. Outdated dependency risk is invisible on aggregate dashboards because the dependency is "still working" right up until it is not.
Pattern 4: Short-term fixes. Code explicitly written to ship a feature under deadline pressure, then never revisited when the deadline passed. The TODO comment from years ago is still there.
The hack that "we'll fix next sprint" is now load-bearing.
These four patterns accounted for the majority of the 5% across every stack we mapped. They share one trait: each was invisible to aggregate reporting.
Now that we know what the 5% looks like, how does an Engineering VP actually go after it?
The 90-Day Playbook: From Identification to Resolution
The playbook is four phases over twelve weeks. It works because it is focused, not because it is clever.
Weeks 1-2: Identify and freeze. Run the three benchmarks at file and function granularity. Rank the top 5% by incident correlation. Freeze changes to those modules pending review. No new features land on top of the lethal hotspots.
The freeze alone cuts new incidents in the affected modules almost immediately. The cause of most incidents in those files is the next change.
Weeks 3-4: Triage each hotspot. Decompose high-complexity functions into smaller units with single responsibilities. Extract duplicated logic into shared utilities with a single owner.
Pin outdated dependencies to known versions. Plan the upgrade path. Every action in this phase reduces the surface area of the 5%.
Weeks 5-8: Refactor with discipline. Use round-robin assignment so tribal knowledge does not re-accumulate in one person's head. Enforce code review best practices with automated style and complexity gates in CI.
No PR merges into a former hotspot if it raises the file's complexity score or drops its coverage. The gate is the safety net.
Weeks 9-12: Cover and re-baseline. Add test coverage to push the top 5% toward strong coverage. Then re-run the three benchmarks and verify the hotspots have moved out of the top decile.
If they have not, the engineering refactor methodology needs another pass on those specific files.
The speed difference comes from focus. You are not refactoring the codebase. You are refactoring the 5% that causes 68% of the pain.
What does the engineering org actually look like after the 5% has been addressed?
What Changes When You Fix 5% Instead of Everything
The numbers shift disproportionately, and that is the point.
Because the 5% was generating 68% of incidents, even partial reduction of its blast radius produces a disproportionate return. Teams that follow the playbook typically see this in production incident reduction metrics within one quarter.
On-call burden shifts from "constant firefighting in the same modules" to "manageable rotation across stable systems." Engineers stop dreading their on-call weeks. Retention improves quietly in the background.
Engineering velocity recovers. Features ship faster because engineers no longer pay tax on broken code.
This is the engineering ROI calculation that justifies the playbook to the board.
The hidden upside is cultural. Teams that fix the 5% start trusting their dashboards again. Leadership starts trusting engineering estimates.
The gap between management metrics and incident reality closes. The next round of tech debt becomes visible before it becomes lethal. This is the discipline we build into every production system we ship at Levitation.
Frequently Asked Questions
How do you actually identify which 5% of code is causing incidents?
Run cyclomatic complexity, code duplication, and code coverage benchmarks at the file or function level, not codebase-wide. Cross-reference the bottom-decile outputs from each metric with your incident log to find the overlap. That overlap is almost always the 5%.
Is engineering debt the same as technical debt?
They overlap but differ in scope. Technical debt typically refers to code-level shortcuts. Engineering debt measurement is broader, covering testing gaps, outdated dependencies, review discipline, and process debt that compounds over time.
Both contribute to tech debt incidents. But engineering debt is the more actionable frame for VPs.
How long does it take to see fewer production incidents after addressing the top 5%?
Most teams see measurable incident reduction within one quarter of completing the 90-day playbook. The first drop comes from the freeze-and-triage phase. The larger reduction comes once refactored modules return to production with coverage gates in place.
Can AI coding tools make the 5% problem worse?
Yes, if used without the same benchmarks in place. AI accelerates code generation, which can accelerate duplication and complexity in the absence of quality gates.
The benchmarks above are how you keep that from happening. This tracks with what we saw across teams adopting AI tooling and in how AI coding assistants break engineering metrics.
What is the first step an Engineering VP should take this week?
Pull your last 90 days of incident data and rank the implicated files by frequency. Then run cyclomatic complexity and code coverage on those files. The overlap is your 5%.
You do not need a new tool to start. You need to stop looking at aggregates.
Sources
Research and references cited in this article:
- 8 Code Quality Metrics Every Engineering Team Should Track
- 2026 AI Code Review Benchmark: Precision, Recall & F1 Score Analysis
- AI Coding Benchmarks 2026: Adoption, Output, and Quality Data | Developer Productivity
- AI Code Quality Crisis 2026: Engineering Leader Guide
- AI Code Quality Debt: What Strong Engineering Teams Do Differently | Sonar Summit 2026
- All Code is Tech Debt
- Technical Debt: Causes, complications, and how best to correct it
- Technical Debt (Tech Debt): A Complete Guide - Confluent
- What Is Technical Debt: Common Causes & How to Reduce It | DigitalOcean
- What Is Technical Debt in AI Coding? Types & Impact Explained
- Code Review Best Practices - The Complete Guide for Engineering Teams (2026) - DEV Community
- Manage technical debt by prioritizing issues based on impact
About the author
Mayank Singh is a software developer at Levitation Infotech, where he builds web and AI-powered applications across the company’s fintech, healthcare, and enterprise projects.
