# Code Smell

> A hint that code has a deeper problem, even though it works.

**Field:** Software Development  
**Category:** Testing & Quality  
**Also known as:** Code Smells, Smell

## Think of it like

Think of it like a funny smell in the fridge. It is not proof of a problem, but you should look.

## Definition

A code smell is a sign in the code that something deeper might be wrong. It is not a bug, and the code may work fine today. Common smells are very long functions, the same code copied in many places and functions with too many inputs. Each one makes the code harder to read and change. The usual fix is refactoring.

## Example

Jack finds the same 15 lines of tax code pasted in four files. It works, but it smells: a tax change now means four edits.

## Why it matters

Smells are cheap to fix early and dear to fix late, once more code has grown around them.

## Common mistake

Treating every smell as a must-fix bug. A smell is a reason to look, and sometimes the code is fine as it is.

## Three principles

- **A warning sign.** Not a bug.
- **Common ones.** Long, copied, too many inputs.
- **Fixed by refactoring.** When it is worth it.

## Related terms

- [Refactoring](https://learn.benibix.com/term/development/refactoring)
- [Technical Debt](https://learn.benibix.com/term/development/technical-debt)
- [Linter](https://learn.benibix.com/term/development/linter)
- [Static Analysis](https://learn.benibix.com/term/development/static-analysis)

## Told apart from

- [Code Smell vs Technical Debt](https://learn.benibix.com/compare/code-smell-vs-technical-debt): A code smell is a sign in the code that something might be wrong. Technical debt is the cost you pay later for a quick fix you chose. A smell is often how you spot the debt, but not every smell is debt worth paying back.

---

Source: https://learn.benibix.com/term/development/code-smell
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
