use caseofficial ogbuilds guide

Code smells: the common ones, with examples and how to catch them

By ogbuilds, the studio behind clean·vibes · updated 2026-07-16

the short answer

A code smell is a surface sign that code will be hard to maintain — not a bug, but a pattern that predicts trouble: duplicated blocks, oversized files and functions, dead or commented-out code, deep nesting, and inconsistent conventions; you catch them by reading the whole repo for these patterns, which is what a code quality checker like clean·vibes does automatically, scoring each category and pinning every smell to a file and line.

"Code smell" is the term for code that works but signals a maintainability problem — a hint, not a failure. The name (from Kent Beck and Martin Fowler) is deliberate: a smell isn't proof something's broken, it's a reason to look closer, because the pattern reliably precedes the pain.

the clean·vibes dashboard — paste a GitHub link to detect code smells across a whole repo with a cleanliness score and per-file findings
code smells, detected across a whole repo: paste a link, get them scored and located

What counts as a code smell

A code smell is a structural pattern that makes code harder to read, change, or trust — without necessarily being a bug. The classic examples: duplicated code (the same logic in more than one place, so a fix has to be made more than once), long methods and files (too much doing too much to hold in your head), dead code (unused functions, unreachable branches, commented-out blocks left "just in case"), deep nesting (four-plus levels of if/for that hide the actual logic), and inconsistent conventions (the codebase disagreeing with itself about naming, formatting, or structure).

What unites them is cost, not correctness. Each one is a small tax on every future change to that area of the code, and they compound: a long file that's also duplicated and inconsistent is far harder to work with than any one of those problems alone. That's why smells are worth finding before they force a painful refactor rather than after.

The most common smells in real repos

When we ran the clean·vibes rules engine over 549 public self-described AI- and vibe-coded repos, the most common smells were remarkably consistent: commented-out code appeared in 59.2% of repos, deep nesting in 53.6%, files past ~600 lines in 56.1%, cross-file duplication in 46.4%, and in-file repetition in 41.2%. More than half the corpus carried at least one duplication finding, and half carried dead code.

The pattern is telling: the most common smells are the ones that accumulate silently. Nobody decides to leave commented-out code or let a file grow past a thousand lines — it just happens, one small addition at a time, because each individual step works. That's exactly why a checker helps: it makes the slow accumulation visible in one pass instead of waiting for it to become a rewrite.

Finding smells across a whole repo

Some smells are visible in a single file — a long method, deep nesting — and a good linter or a careful read will catch those. The expensive ones aren't: cross-file duplication, a module nobody imports anymore, a codebase that's inconsistent between its halves. Those only exist at the repo level, so finding them means reading the whole tree, not one file at a time.

That's what clean·vibes does: paste a GitHub link and it scores the codebase across six categories that map directly onto the common smells — structure and size, readability and complexity, duplication, dead code, consistency, and repo hygiene — then lists each smell with its file, line, and a one-paste fix prompt. You get the whole-repo picture in under a minute, and a clear order to tackle it in.

Common code smells and where clean·vibes catches them

SmellWhy it costs youclean·vibes category
Duplicated codeOne fix has to be made in many placesDuplication
Long files & methodsToo much to hold in your head at onceStructure & size
Dead / commented-out codeNoise that hides the code that mattersDead code & leftovers
Deep nestingThe real logic is buried levels downReadability & complexity
Inconsistent conventionsThe codebase disagreeing with itselfConsistency & style

frequently asked

Is a code smell a bug?

No. A code smell is code that works but signals a maintainability problem — a reason to look closer, not proof something's broken. Bugs make the app wrong; smells make it expensive to change. A checker finds smells; tests find bugs.

What's the most common code smell?

In our scan of 549 vibe-coded repos, commented-out code was the most common (59.2% of repos), closely followed by deep nesting, oversized files, and cross-file duplication. They're the smells that accumulate silently, one small addition at a time.

How do I find code smells in my project?

For per-file smells, a linter helps. For the repo-level ones — cross-file duplication, dead modules, inconsistency — paste your GitHub link into clean·vibes: it scores the whole codebase across six smell categories and pins each finding to a file and line with a fix.

Should I fix every smell?

No — fix the ones that cost you. A smell in code you rarely touch matters less than one in the file you edit weekly. clean·vibes ranks findings by severity and category so you can start where the maintainability tax is highest.

Last updated July 16, 2026

ready to try clean·vibes?

score your repo