A lead engineer I spoke with recently approves every pull request their team ships. The team had adopted an AI coding assistant, and output was up. Nothing was failing. But over a few weeks the lead noticed a tell in the diffs: for almost every task, the assistant produced a little constellation of one-line functions. A helper that renamed an existing call. A wrapper used exactly once, three lines above its only caller. Getters for things that didn't need getting.
No single PR was wrong. Each one read fine on its own. Eventually the lead stopped trusting the aggregate and asked the team to go back and audit what the AI was actually writing, by hand.
The tool that was supposed to save review time had quietly created a second review job.
What the pattern looks like
Here's a mild, real-shaped example. One task, four new functions:
function getUserId(user: User) {
return user.id;
}
function isActiveUser(user: User) {
return user.status === "active";
}
function formatUserLabel(user: User) {
return `${user.name} (${user.email})`;
}
function buildUserLabel(user: User) {
return formatUserLabel(user);
}getUserId renames a property access. buildUserLabel is a pass-through: it calls one function, forwards the argument, adds nothing. Each is called once. A human doing this task would probably have written one function, or none.
Multiply that by every task, every day, for a quarter.
Why assistants write like this
Our best guess: the models absorbed twenty years of clean-code advice in which extracting a function is almost always praised and almost never questioned. Extraction looks like craftsmanship in a diff. And a diff is exactly the unit the model is optimizing, because a diff is what gets reviewed.
The cost sits at a level nobody reviews. Reading fragmented code means chasing every behavior through three trivial hops. Stack traces get taller. Grepping gets noisier. Review fatigue compounds, because fifteen tiny functions take longer to verify than the four lines of logic they contain.
Why review misses it
Reviewers see PRs. This pattern doesn't live in any PR; it lives in the sum of them. Three harmless helpers in Tuesday's PR, three more on Wednesday. No individual approval was a mistake, and yet six months later every file is a pile of indirection and the lead engineer is running a manual audit on their own codebase.
To be fair to the assistants: extraction is often right. A one-line function that names a business rule, isEligibleForRefund, is good code, and we'd defend it. The problem isn't any individual small function. It's the ratio.
It's not one team
We assumed this story was one team's bad luck, then went looking. Public GitHub is full of AI instruction files, the CLAUDE.md and .cursorrules files teams write to steer their assistants, and thousands of them carry rules against this exact behavior. PyTorch's executorch repo puts it plainly: "No trivial (1-2 LOC) single-use helpers." Nobody writes a rule against a problem they hit once, and there are thousands of these files.
The research record backs the reviewers up. One 2026 study found that 9.9% of AI-generated methods get deleted during code review, which the authors describe as unnecessary cognitive load on the humans doing the reviewing. GitClear's analysis of 623 million changed lines found cross-file function calls down 35% since 2023: new code increasingly stands alone instead of reusing what already exists.
One honest complication. The pattern varies by model and workflow: a large 2026 study of AI-generated files found some assistants fail in the opposite direction, producing fewer but fatter functions, still wrapped in deeper call hierarchies than human code. The constant is needless indirection. Sometimes it looks like a pile of tiny wrappers, sometimes like an extra abstraction layer around a five-line change. A useful detector has to count both.
The ratio is countable
That's the useful part. "The AI writes slop" is a vibe, and vibes lose arguments with velocity charts. But this particular slop has a signature you can count in any PR: how many new functions the change introduces, what fraction are trivial (one statement, give or take), what fraction are pass-through wrappers that forward to one call, and what fraction have exactly one caller.
A PR that adds 17 functions, 14 of them one-liners, 12 with a single call site, is over-fragmented. That's a number a lead engineer can put in front of a team, and a number a team can push back on. Both directions beat arguing about taste.
If you want to check your own codebase today, you can approximate this with a script and your language's parser in an afternoon. Count new function declarations per merged PR and sort by body length. In our experience the distribution tells you the story fast.
Where Qualyn fits, honestly
Qualyn today estimates how much of each change is AI-written and weighs it in the release call: safe to ship, why, and what would change the answer. It does not yet count fragmentation. We're building that detector now: a per-PR function inventory that reports exactly the signature above, with the offending function names and line numbers attached, so the conversation starts from evidence instead of suspicion.
Plenty of teams have already written rules telling their assistant not to do this. As far as we can tell, nobody measures whether it listened. That's the gap the detector closes.
The lead engineer in the story found the pattern with their eyes, at the cost of their own review capacity and a team-wide audit. That job should be automatic. If you want to run the detector on your repos while it's in beta, we're looking for teams to test it against real history.
Key takeaways
- AI assistants repeatedly over-extract: trivial single-use helpers and pass-through wrappers that pass review one PR at a time while the codebase fragments underneath.
- The pattern has a countable signature: new functions added, trivial ratio, pass-through wrappers, and single-caller share.
- Thousands of public AI instruction files ban this behavior, but nothing measures whether the assistant complied. Measurement, not more rules, closes the gap.
Frequently asked questions
Are one-line functions bad?
No. A one-line function that names a concept or isolates a decision is good code. The warning sign is a high ratio of trivial, single-use functions arriving together in AI-assisted changes: many wrappers, each called once, adding indirection without meaning.
Why do AI coding assistants create so many small functions?
Coding models are trained on material where extracting helpers is presented as best practice, and they optimize the readability of a single diff. Over-extraction looks clean in the PR that introduces it; the cost appears later, spread across the codebase.
How can you detect over-fragmentation in a pull request?
Count four things: new functions added, the fraction with roughly one statement, the fraction that only forward to another call, and the fraction with exactly one call site. High values on all four indicate over-fragmentation.
Can code review catch this without tooling?
Sometimes, but unreliably. The pattern accumulates across many PRs, and each individual PR looks acceptable. Reviewers judge changes one at a time, which is exactly the blind spot this pattern exploits.
Is over-fragmentation a common problem with AI coding assistants?
Yes. Thousands of public AI instruction files (CLAUDE.md, .cursorrules, AGENTS.md) contain rules against single-use helpers and unnecessary abstractions, and research from 2026 found that 9.9% of AI-generated methods are deleted during code review. The pattern varies by model and workflow, but the underlying tendency toward needless indirection is widely reported.
Does a high AI-code percentage mean a change is unsafe?
Not by itself. AI share is one risk input among several: test evidence, coverage of changed lines, security findings, and structural signals like fragmentation. The decision should rest on the combination, not any single number.
Sources
- pytorch/executorch CLAUDE.md — "No trivial (1-2 LOC) single-use helpers"
- Sawada et al. 2026 (arXiv 2605.06464) — 9.9% of AI-generated methods deleted during review
- GitClear, The Maintainability Gap (2026) — cross-file function calls down 35% since 2023
- Large-scale empirical study of AI-generated code (arXiv 2603.27130) — deeper call hierarchies, model-dependent structure