Code Smells Flashcards
Long Method
Method is too long.
Large Class
Class has too many LoC
Feature Envy
Reveals a method (or method-to-be) that would work better on a different class. A method accesses the data of another object more than its own data.
Case Statement
Happens when your next steps depend on the type of the object you operate, expressed as a case statement or a conditional.
Shotgun Surgery
When some logic changes, you need to change it in multiple places, which you need to be aware of.
Divergent Change
When there are multiple reasons for some unit to change.
Long Parameter List
When a method has more than x parameters.
Duplicated Code
When the same code is in multiple places.
Uncommunicative Name
When a unit’s name does not reveal its intent.
Single Table Inheritance
When subclassing AR models.
Comments.
When adding useless, or as a result of complexity, comments.
Mixin
When logic shared with modules instead of class
Callback
Adding non-persistence-related callbacks to AR models.