Code Smells
Code smells are more granular smells that are usually easier and less costly to fix than design smells. There are four categories of code smells:
Bloaters
Something that has grown so large that it cannot be effectively handled:
- Long Method: Methods should do only one thing. Single Responsibility Principle (SRP) violation. One level of abstraction. "Keep all entities small" object calisthenics rule violation.
- Large Class: Classes should have only one responsibility. Possible SRP violation. No more than 50 lines per class. "Keep all entities small" object calisthenics rule violation.
- Primitive Obsession: Don't use primitive types as substitutes for classes. If the data type is sufficiently complex, use a class to represent it. "Wrap all primitives and strings" object calisthenics rule violation.
- Long Parameter List: "Keep all entities small" object calisthenics rule violation.
– Ideal: 0...