What is Code Smell?
A code smell is a surface-level indicator in source code that suggests a deeper problem. The term was popularized by Martin Fowler and Kent Beck. Code smells are not bugs — the code works correctly — but they indicate structural weaknesses that will make future changes harder and more error-prone.
Common code smells include: duplicated code, long methods, large classes, long parameter lists, divergent change, shotgun surgery, feature envy, data clumps, primitive obsession, and dead code.
Code smells are the early warning system for technical debt. Each smell is a small amount of debt. Individually, they're manageable. Collectively, they compound into the maintenance burden that slowly consumes engineering capacity.
Why It Matters
Code smells are leading indicators of technical debt. By the time technical debt becomes visible to management (missed deadlines, rising bug counts, slow feature delivery), the underlying code smells have been accumulating for months or years. Teams that actively monitor and address code smells prevent technical debt from reaching critical levels.
Frequently Asked Questions
What is a code smell?
A code smell is a pattern in source code that suggests a deeper structural problem. The code works but is poorly organized, making future changes harder and more risky.
What are common code smells?
Common code smells include duplicated code, overly long methods, large classes, feature envy (a method that uses another class more than its own), dead code, and shotgun surgery (one change requires editing many files).
Related Terms
Need Expert Help?
Richard Ewing is a Product Economist and AI Capital Auditor. He helps companies translate technical complexity into financial clarity.
Book Advisory Call →