CodekeeperTransaction Services

InsightsAI in transactions

AI code quality: what coding assistants leave in a codebase

AI coding assistants make it cheap to produce code. They do not make it cheap to understand, review or maintain it. For a buyer in technical due diligence, the quality question is whether the team's controls kept pace with its output, and the code history shows the answer.

6 min readUpdated Codekeeper Transaction Services

What changes when code is cheap

Before assistants, the rate at which a team could write code limited how much it could get wrong. Each line cost effort, so engineers reused what existed and thought before adding. That brake has weakened. An engineer can now produce far more in a day, and the limit moves from writing to reviewing.

Review capacity has not grown at the same rate. A reviewer still needs time to read a change, understand its intent and consider what it might break. Where output has multiplied and review has not, something gives: either changes wait, or they are approved without being read. The second leaves marks.

None of this is an argument against the tools, and a buyer should not penalize a target for adopting them. The concern is narrower: code that entered the product without anyone understanding it.

Signals of careless use

Volume without understanding. Very large changes merged quickly, with a brief description and no discussion. Modules that grew fast and that no current engineer can explain in detail. The test is simple and human: ask the listed author how a piece works and why it was done that way.

Duplicated patterns. An assistant asked to solve a problem will often write a fresh solution instead of finding the existing one. The result is the same logic implemented several times in slightly different ways: three date parsers, four ways of calling the same service. Each copy must be found and changed when the rule changes, and one will be missed.

Inconsistent idiom. Within one module, different conventions for naming, error handling and structure, as if written by many hands.

Hollow tests. Tests generated alongside the code tend to confirm what the code does, not what it should do. Coverage figures look healthy while the tests would pass even if the logic were wrong. Look at what the tests assert, and whether any were written from a requirement or a past defect.

Surplus. Unused functions, abstractions with a single user, dependencies added for one small task, comments that restate the line below them. Together they enlarge the surface that must be read, secured and maintained.

Plausible errors. Error handling that catches a failure and carries on silently, input that is not validated, an outdated version of a library. Generated code is fluent, which makes such defects harder to see in review than a clumsy human mistake.

What the conventional measures do and do not mean is covered in code quality metrics.

Signals of healthy use

AreaHealthy useCareless use
Change sizeSmall changes with a stated purposeLarge changes with thin descriptions
ReviewComments, questions and requested revisionsApproval within minutes of a large change
TestsWritten from requirements; fail when logic is brokenMirror the implementation; rarely fail
ReuseExisting components extendedParallel implementations of the same thing
StructureOne architecture, applied consistentlyStyle varies file by file
PolicyApproved tools, known settings, written rulesWhatever each engineer installed

A healthy team treats the assistant as a fast junior colleague whose work is always checked. The engineer who submits a change remains its author in every sense that matters: able to explain it, responsible for it, and expected to have tested it.

Automated gates help. Builds that run tests, static analysis and dependency checks on every change catch part of what a hurried reviewer misses.

Review practice is the control

Of all the signals, review is the one to weigh most, because it is the point at which a person takes responsibility for generated code. The record of changes shows it in detail.

Look at the time between a change being proposed and approved, set against its size. Look at how many changes were merged by their own author. Look at whether review comments engage with substance or consist of approval alone. And look at how these measures moved after assistants were introduced. A team whose changes grew much larger while its review time fell has told you what happened.

Who understands the code

Quality is partly a question of knowledge. Reviews have long measured how much of a codebase rests on one or two people, as described in key-person risk. Generated code adds a new case: code that rests on nobody.

A module can have a named author who prompted, accepted and merged it without forming a working model of how it behaves. In the history, that person appears to own it. In practice, the knowledge was never there to be lost. This matters most in the transactions where the buyer cannot rely on the team afterward, such as an asset purchase or a carve-out.

What it means for the price

Careless use shows up as maintenance cost. Duplicated logic and hollow tests slow every later change and raise the rate of defects. That is technical debt of a familiar kind, and it is estimated the same way: the effort to consolidate, to test properly and to document, in engineer-months.

The estimate should be confined to where the problem is. A provenance analysis by module, described in GenAI code provenance, shows which parts of the product carry a high generated share, and the signals above show which of those were handled with care.

How we approach it

Every report we issue includes code quality metrics, an architecture map and GenAI code provenance: an estimate of the share of the codebase generated by AI and its concentration by module. Read together, they show where generated code sits and what condition it is in. The provenance figures are estimates and are presented as such.

From the code history we also report bus factor, knowledge concentration, contributor turnover and the share of external contributors. In the Analyst-Verified Report, an in-house analyst verifies the findings and rates them in the context of the company's stage. The people who read the code have built products and run engineering teams, and can tell a deliberate shortcut from a problem that will cost money.

Remediation effort is stated in engineer-months and as a cost band, and the work is sequenced into a plan for the first hundred days, with completed fixes verified by re-scan. Our technology page describes the analysis, and the sample report shows how findings are presented.

Questions we are asked

Is code written with AI assistants lower in quality?

Not as a rule. Quality depends on how the team reviews, tests and integrates what the assistant produces. The same tools yield sound code in a disciplined team and a maintenance burden in an undisciplined one, and the record of changes shows which applies.

Can you tell from the code whether review was thorough?

To a useful degree. The record of changes shows how large each one was, how long review took, who approved it and whether there was discussion. Patterns across many changes are informative, although no single change proves anything.

What should a seller fix before diligence?

Start with the modules that matter most to the product. Consolidate obvious duplication, add tests that would fail if the logic were wrong, and make sure a named engineer can explain each critical module. Our data room stays synchronized with the seller's systems and the report can be regenerated until closing, so fixes made during the process appear in the next version.

This article is general information for people working on software transactions. It is not legal, financial or insurance advice.

Dealmaking is your craft. The technology is ours.

Tell us about the transaction and its timetable. We will set out the scope we would advise, and what the first report would cover.