Code Smells Flashcards
Signs that there might be something wrong with the code
code smells
Means your code is doing too much
Large Classes and Long Methods
Using primitive instead of creating own classes
Primitive obsession
Data that always appear together
data clumps
methods have too many parameters
Long Parameter List
method or class is trying to exhibit too many behaviours
Too many switch statements
When subclass does not use members inherited from a superclass
Refuse Bequest
Close related classes should share the same interface, so they can be pluggable
Alternative classes with different interface
Several classes changed for every new feauture/code
Shotgun surgery
Same class changed for different reason
Divergent Change
Class that doesnt do much
Lazy class
when the same code is repeated multiple times in different parts of the application.
Duplicate Code
Unused code
Dead Code
When a method excessively accesses the data of another class
Feature envy
When two classes are constantly accessing each other members
Inappropriate Intimacy