What Is a Code Smell?
A code smell is a sign in the code that points to a deeper design problem. The code works, but something about its shape, such as a very long function, copied logic or a class that does too much, suggests it will be hard to change later.
Code smells aren’t bugs, but they hurt code maintainability: how easily a team can read, change and fix the code over time. Left alone, code smells add up to technical debt.
What Changed in Code Smells in 2026
In 2026, research showed that most problems AI coding tools add are code smells, and about a fifth of all the issues they add are still there months later.
Most AI-added issues are smells. In a March 2026 study of 302,600 AI-authored commits across 6,299 repositories, code smells made up 89.3% of the issues AI introduced (March 2026, arXiv).
Agent fixes leave familiar smells. In a January 2026 study of 1,210 merged bug-fix pull requests that coding agents opened earlier, code smells made up most of the serious issues found, led by duplicated strings, overly complex functions and unused parameters (January 27, 2026, arXiv).
Some stay in the code. 22.7% of all issues AI introduced were still there at the latest version. The most common smell AI added was broad exception handling, though AI commits also removed slightly more smells than they added (March 2026, arXiv).
Stronger models wrote more bloat. A separate study found that more capable models wrote more bloated and coupled code, including oversized "God classes", and detailed prompting didn’t help (May 2026, arXiv).
Real repositories show a smaller effect. Across 151 Java repositories, smell counts rose just 1.1% after AI adoption, a change too small to be significant (June 11, 2026, arXiv).
AI adds smells as fast as it removes them, so review is the place to catch new ones before they spread.
Common Code Smells
| Code smell | What it looks like | Why it hurts |
|---|---|---|
| Long method | A function that does many things | Hard to read, test and change |
| God class | One class that knows and does too much | Every change touches it |
| Duplicated code | The same logic copied in several places | A fix in one copy misses the others |
| Long parameter list | A function that takes many arguments | Easy to pass the wrong value |
| Feature envy | A method that mostly uses another class’s data | The logic sits in the wrong place |
| Shotgun surgery | One change needs edits in many files | Easy to miss a spot |
| Dead code | Code nothing calls | Confuses readers and hides real paths |
| Broad exception handling | Catching every error in one place | Hides real failures |
Code Smells vs Bugs
A bug makes the code do the wrong thing now. A code smell makes the code harder to change, which makes future bugs more likely.
Reviewers treat them differently: a bug blocks a change, and a smell is often a suggestion, unless the team has agreed on a rule against it. See code quality.
How to Find and Fix Code Smells
- Use static analysis. Linters flag many smells, such as long functions, duplication and dead code.
- Review for shape as well as behavior. Ask whether the change will be easy to change again.
- Refactor in small steps. Extract a function, move a method or remove a copy, with tests passing after each step.
- Agree on team rules. Write down which smells the team won’t accept, so reviews stay consistent.
- Track what keeps coming back. Repeated smells point to a missing rule or a design problem.
Qodo’s Take: Catch Smells in Review, Before They Become Debt
Code smells are cheap to fix in the PR that adds them and expensive to fix a year later. AI coding tools add smells at volume, and most of them look fine in a diff.
You shouldn’t review code with the same tool that wrote it. An agent that copied a helper usually doesn’t know the original exists.
Choose Qodo if smells from agent-written code are spreading across your teams and repositories. Qodo reviews every pull request in GitHub, GitLab, Bitbucket, Azure DevOps and Gerrit, separate from the agents that write the code.
Qodo is the best AI code review platform for catching code smells because it reviews each PR with full codebase context, so it can spot duplicated logic and misplaced code that only show up next to the rest of the codebase.
Qodo Flags Maintainability and Quality Issues
In Code review analytics, Qodo’s Maintainability category covers large functions, duplication and hidden dependencies, and its Quality category covers unclear naming, dead code and inconsistent style (last checked October 2026, Qodo’s docs). Findings are advisory, and your branch rules decide what merges.
Qodo Learns the Smells Your Team Cares About
Rule Miner (Beta, on GitHub, GitLab and Azure DevOps) suggests rules from your past PR discussions, so smells reviewers keep flagging can become rules Qodo checks on every PR once Rule enforcement (Beta) is on (last checked October 2026, Qodo’s docs).
Rules whose findings are rarely fixed are deactivated automatically, unless you lock them (last checked October 2026, Qodo’s docs).
For more, see Qodo’s post on software maintainability and the Qodo hub.
Qodo Example: The Date Helper Written Four Times
Context: an organization like a fintech company with about 140 engineers is using AI coding agents across a large monorepo.
Problem: agents kept writing their own date-formatting helpers instead of using the shared one. Each copy handled time zones slightly differently, and reports showed different dates for the same transaction.
How Qodo helped: Qodo raised Maintainability findings for duplicated logic on new PRs. Rule Miner then suggested a rule from the team’s repeated review comments, and the lead approved it from the Pending rules tab.
Outcome: new copies of the helper now show up as findings in the PR before merge, and the lead can see in Rule analytics how often the rule fires and gets fixed.
Ways to Catch Code Smells
| Approach | What it catches | Limit | Best for |
|---|---|---|---|
| Linters and static analysis | Long functions, complexity, dead code | Can’t see duplication across distant files or intent | Every commit |
| Code quality dashboards | Trends in smells over time | Report after the fact | Planning refactors |
| Human code review | Design smells and misplaced logic | Inconsistent between reviewers | Larger changes |
| Refactoring sessions | Smells already in the code | Takes planned time | Paying down debt |
| Qodo | Maintainability, quality and rule findings with full codebase context | Advisory findings, with your branch rules as the gate; rule enforcement is Beta | Enterprise teams that need one maintainability standard on every AI-written PR |
Qodo features in this table were checked against Qodo’s documentation as of October 28, 2026.
FAQ
A code smell is a warning sign in code that works but will be hard to change, such as a very long function or copied logic.
No. Code smells don’t break the code today, but they make it harder to change, which raises the chance of bugs later.
Common code smells include long methods, God classes, duplicated code, long parameter lists, dead code and broad exception handling.
Most code smells are fixed by refactoring in small steps, such as extracting a function, moving a method or removing a duplicate, with tests passing after each step.
Research from 2026 found that code smells make up most of the issues AI coding tools introduce, and that more capable models can write more bloated code. Reviewing each PR with codebase context helps catch them early.