Gap Analysis Phase 2: The Overlooked Liability
Everyone talks about unimplemented requirements. Nobody talks about code that has no requirement behind it. That code is invisible technical debt.
The invisible problem
Every engineering team obsesses over Phase 1: did we build all the requirements?
Nobody looks at Phase 2: do we have code that has no requirement?
That code exists in every codebase. Old features nobody remembers. Experiment branches that were never deleted. Edge case handling that seemed like a good idea at the time. Feature flags that are always on. Code that was relevant two years ago.
It is all there. Silent. Unmaintained. Accumulating.
Why orphan code matters
Orphan code is technical debt you do not know you have. It is a liability in four ways:
Maintenance burden Every line of code you ship is code you have to maintain. You have to test it, debug it, update it when dependencies change. Code with no requirement means nobody knows why it exists. So nobody maintains it properly. It rots.
Security surface area Dead code is still code your security team has to audit. A vulnerability in orphan code is just as dangerous as a vulnerability in active code. You are paying security cost for code that provides no value.
Cognitive load Engineers reading the codebase ask: why is this function here? What does it do? Is it used? They have to trace through dead code to understand what is actually live. That slows onboarding. It slows debugging.
Feature confusion - Your product documentation says the feature works one way. But your code has three different implementations because the feature evolved and old code was never deleted. Users get confused. QA tests the wrong path. Bugs hide in dead code paths.
Phase 2 finds the orphan codeGap Analysis Phase 2 scans your codebase and asks one simple question: is this code tied to a requirement?
For every function, module, API endpoint, and feature flag, Phase 2 checks: does this have a story or acceptance criterion backing it up?
The answer is always one of three:
REQUIRED: this code implements a current requirement. Keep it.
DEPRECATED: this code used to be required but that requirement changed or was deleted. Consider removing it.
ORPHAN: this code has no requirement we can find. It should not exist.
The numbers tell the story
On average, codebases have 15 to 25 percent orphan code by volume. That is one out of every four to five functions with no requirement.For a codebase of 50,000 lines, that is 7,500 to 12,500 lines of code nobody asked for.
Every one of those lines is a maintenance burden. A security surface. A cognitive load.
Why teams do not do Phase 2
Phase 2 is uncomfortable. It forces you to look at all the decisions you made that are now invisible debt.
It is easier to ask: did we build the new features? Yes. Ship it.
It is harder to ask: do we have code that should not exist? Because the answer is always yes. And then you have to decide: do we delete it? Do we archive it? Do we document it?What to do with orphan code
When Phase 2 finds orphan code, you have four options:
Option 1: Delete it
If it is truly dead, delete it. This is the best option. Cleaner codebase. Lower maintenance burden.
Option 2: Archive it
If you think you might need it someday but it is not current, archive it. Move it to a deprecated module. Do not delete, but mark it clearly as not active.
Option 3: Document it
If it is a legitimate edge case or defensive programming, document why it exists. Add a comment or a requirement that explains it. Make it visible instead of invisible.
Option 4: Requirement it
If the code is actually valuable but just was never connected to a requirement, create the requirement. Link the code to it. Now it is not orphan anymore.
Using Phase 2 to lower technical debt
Run Phase 2 before every major release. Ask: how much orphan code are we shipping?
If the answer is high (over 10 percent), you have a problem. You are shipping maintenance burden.
Start a cleanup initiative. Delete aggressively. Every line you delete is one less line to maintain forever.
The competitive advantage
Teams that manage orphan code are faster than teams that do not. They have cleaner codebases. Faster CI/CD. Easier onboarding. Better security posture.
By the time you notice, the advantage is already there. The other team shipped twice as fast because they did not have to read through dead code.
Next steps
Phase 1 finds what you did not build. Phase 2 finds what you built that you should not have. Together, they give you a complete picture of your codebase health.
Try Phase 2 on your project. Find your orphan code. Decide what to do with it. Watch your velocity increase.
Find your orphan code. See Phase 2 in action. Read the comparison doc.



