New York

October 15–17, 2025

Berlin

November 3–4, 2025

How AI generated code compounds technical debt

“I don't think I have ever seen so much technical debt being created in such a short period of time"
February 19, 2025

You have 1 article left to read this month before you need to register a free LeadDev.com account.

Estimated reading time: 3 minutes

GitClear’s latest report exposes rising code duplication and declining quality as AI coding tools gain in popularity.

It’s never been easier to create code. With today’s LLM-based coding assistants embedded in the Integrated Development Environment (IDE), you can create multi-line code blocks with a single prompt or press of the tab key.

Ever since AI coding tools entered the scene, engineering best practices like the don’t repeat yourself (DRY) principle have been slipping.

“I don’t think I have ever seen so much technical debt being created in such a short period of time during my 35-year career in technology,” says API evangelist Kin Lane, referring to AI-generated code proliferation.

GitClear’s second-annual AI Copilot Code Quality research analyzed 211 million changed lines of code from 2020 to 2024 across a combined dataset of anonymized private repositories and 25 of the largest open-source projects. It found multiple signatures of declining code quality – sounding the alarm around the long-term repercussions of quick wins with AI.

Code reuse is dying

During 2024, GitClear tracked an 8-fold increase in the frequency of code blocks with five or more lines that duplicate adjacent code – showing a prevalence of code duplication ten times higher than two years ago.

That same year, 46% of code changes were new lines, while copy-pasted lines exceeded moved lines. “Moved,” lines is a metric GitClear has devised to track the rearranging of code, an action typically performed to consolidate previous work into reusable modules. “Refactored systems, in general, and moved code in particular, are the signature of code reuse,” says Bill Harding, CEO of Amplenote and GitClear.

A year-on-year decline in code movement suggests developers are less likely to reuse previous work, a marked shift from existing industry best practice that would lead to more redundant systems with less consolidation of functions.

Taken from GitClear’s study, AI Copilot Code Quality.

More code lines ≠ success

Unbridled AI code generation is anticipated to carry a long-term maintenance burden, especially for long-lived repositories. Contrary to perceived productivity benefits, the State of Software Delivery 2025 report by software vendor Harness found the majority of developers spend more time debugging AI-generated code and more time resolving security vulnerabilities.

The growing frequency of copy-and-pasted lines in commits might not be alarming to those who’ve copied StackOverflow code during their career. However, the new AI-infused workflow has the potential to dramatically escalate technical debt.

Google’s 2024 DORA report found a trade-off between gains and losses with AI, where a 25% increase in AI usage quickens code reviews and benefits documentation, but results in a 7.2% decrease in delivery stability.

Infinite code = infinite maintenance

Code assistants are incredibly valuable, and most leaders agree AI is imperative to competitive agility. But does unchecked LLM-generated code threaten software maintainability?

Data suggests that if current trends continue, defect remediation and refactoring may soon dominate developer workloads. “If developer productivity continues being measured by commit count or lines added, AI-driven maintainability decay will proliferate,” says Harding.

Unless teams focus on long-term sustainability, AI will push software toward endless expansion – requiring “indefinite maintenance,” he adds.


The cost of cloning code

Beyond maintainability, bloated code has financial implications. “Nobody, including me during much of my 2024 programming, thinks much about the long-term costs,” says Harding.

Duplicated code isn’t just harder to maintain – it’s expensive. Code storage racks up cloud costs. Bugs multiply across cloned blocks, and testing becomes a logistical nightmare, heightening the developer’s operational overhead.

Academic research continually links co-changed code clones – duplicated code blocks that must be updated in multiple places – to higher defect rates. “Code cloning is a common practice that negatively impacts software maintenance,” found a 2023 study by researchers at the Central China Normal University.

Approach the ‘tab’ key with caution

One encouraging finding in GitClear’s research is that the time between commits is shrinking. AI can itself be leveraged to counter some of the drawbacks above too. Cursor, for instance, can help rewrite code to ensure per-line consistency.

Although AI excels at generating one-off code, its context window is limited. Humans still play a critical role in seeing the bigger picture and understanding the full software portfolio. This oversight is essential to make a codebase more cohesive, by refactoring repetitive logic into reusable functions, integrating related modules, or reusing microservices when appropriate.

“There is a lot of utility that AI provides, but the data from this year affirms why long-term-oriented devs might eye their ‘tab’ key with a faint sense of foreboding,” says Harding.