Why quality matters to someone who will never read the code
Software is never finished. The buyer's plan consists of changes to it: new features, integrations, larger customers. Every item on that list is a modification of code that already exists, usually by people who did not write it.
Quality, in the sense that matters commercially, is the ease and safety with which that can be done. Low quality does not stop a product working. It makes each roadmap item slower and riskier than planned.
The measures a report will show
Complexity. The usual measure is cyclomatic complexity: the number of distinct paths through a function, which rises with every condition and loop. A function with many paths is hard to understand, hard to test completely and easy to break.
Duplication. The share of code that appears in more than one place. Where logic has been copied, a fix or a rule change must be made several times, and the copy that is missed becomes a defect.
Test coverage. The share of the code that is executed when the automated tests run. Tests are what let a team change code and learn within minutes whether something else broke.
Churn. How often a file changes, taken from the version history. It shows where the work is going.
Hot spots. Files that score high on both complexity and churn. These are the places where the team spends its time struggling with the code.
| Metric | What it suggests | What it cannot tell you |
|---|---|---|
| Complexity | How hard the code is to understand and test | Whether the complexity is inherent in the problem |
| Duplication | How many places a change must be made | Whether the copies will ever need to change |
| Test coverage | How much code is exercised by tests | Whether the tests check the right results |
| Churn | Where development effort is concentrated | Whether the changes are progress or rework |
| Hot spots | Where defects and delays are likely to cluster | What it would cost to fix them |
Why the numbers need context
Several things change what a score means.
What was counted. Repositories contain code the team did not write by hand: generated files, copied third-party libraries, test data. Including them distorts every score. A competent analysis excludes them and says so.
Where the score sits. A complexity figure for the whole codebase is close to meaningless. The same figure for the module that calculates invoices is a finding. Scores should be mapped to the parts of the system that carry revenue and that the plan intends to change.
How coverage was achieved. Tests can execute code without checking what it returns, which raises coverage and protects nothing. High average coverage with no tests on the payment flow is worse than modest coverage concentrated where failure is expensive.
The problem being solved. Tax rules, pricing engines and scheduling are complicated subjects, and code that handles them will score as complex however well it is written.
Stage and age. A three-year-old product that found its market by moving fast should not be read against the standard of a fifteen-year-old vendor of regulated software.
Code written with AI assistants raises questions of its own, covered in AI coding assistants and code quality.
What the metrics predict, and what they do not
Used with care, these measures are reasonable indicators of a few things. Hot spots mark where defects are likely to cluster. Complexity and duplication together indicate the cost of change and the time a new engineer needs to become useful. Combined with authorship data, they show where knowledge of difficult code rests with one or two people.
They do not tell you whether the software does the right thing: business logic can be clean, well tested and wrong. They do not establish that it is secure, which is why security scanning is a separate exercise. They say nothing about behavior under load, about whether customers want the product, or about whether the present team is good. A strong team may be working in code inherited from a weaker period.
For that last point, trend is the better evidence. Whether complexity and coverage improved or deteriorated over the past two years says more about the people now in the building than any snapshot. The line between what a tool can report and what a person must judge is drawn in automated scans and expert review.
What it does to price and terms
Code quality is seldom a reason to abandon a transaction. Its effect is indirect, through three channels.
The first is remediation cost. Hot spots and untested critical modules are the raw material of the technical debt estimate, expressed in engineer-months. The method is described in technical debt in M&A.
The second is the credibility of the roadmap. A plan that requires rapid change in the worst-scoring part of the system deserves a discount on its timing.
The third is dependence on people. Where difficult code is understood by very few, retention terms carry more weight. Only at the extremes does quality reach the terms directly, for instance where a system that moves money has no automated tests at all and the buyer makes a remediation plan a condition.
How we approach it
Every level of our review reports code quality in the same form: complexity, duplication, test coverage and debt hot spots, with an estimate of remediation effort in engineer-months and as a cost band. Our technology reads the repositories the seller has connected to the data room, and each section of the report states what was examined and what was not.
The Automated Scan Report has a target of 72 hours from the moment the data room is ready to scan. In the Analyst-Verified Report, our standard engagement, an in-house analyst checks the findings, removes false positives and rates each risk in the context of the company's stage.
The report has one format on every transaction, so targets compare like for like. For funds reviewing several companies a year, a quality score in one report means the same as in the last.
Questions we are asked
What is a good test coverage figure?
There is no single figure that separates good from bad. What matters is whether the code that carries revenue and handles money or personal data is covered, and whether the tests check results instead of merely running the code.
Can a seller improve the metrics shortly before a sale?
Some of them, and honestly: removing dead code and updating neglected modules both help. Cosmetic work is visible, though. The version history shows a burst of activity just before the process, and tests written only to raise coverage are easy to recognize.
Does your report treat AI-generated code differently?
The quality measures are the same whoever or whatever wrote the code. In addition, every report we produce estimates the share of the codebase generated by AI and its concentration by module, with the implications for intellectual property and security.
This article is general information for people working on software transactions. It is not legal, financial or insurance advice.