Code smell
A “smell” is a metaphor for bad code, proposed by Kent Beck.
Smells proposed in Refactoring: Improving the Design of Existing Code
Perhaps the list of smells begins with Mysterious name and Duplicated code because these two are the most important. In Test-Driven Development: By Example, Kent Beck defines refactoring as “revealing intention and eliminating duplication.”
- Mysterious name
- Duplicated code
- Long function
- Long parameter list
- Global data
- Mutable data
- Divergent change
- Shotgun surgery
- Feature envy
- Data clumps
- Primitive obsession
- Repeated switches
- Loops
- Lazy element
- Speculative generality
- Temporary field
- Message chains
- Middle man
- Insider trading (code smell)
- Large class
- Alternative classes with different interfaces
- Data class
- Refused bequest
- Comments
See also
- Bad smells in test: Smells commonly found in test cases.