Code Smells How To Identify
Code Smells How To Identify
Large Class
Abusers
You have a complex switch operator Temporary fields get their values (and
All these smells are incomplete or or sequence of if statements. thus are needed by objects) only under
incorrect application of object-oriented certain circumstances. Outside of these
programming principles. circumstances, they’re empty.
Refused Bequest
If a class performs only one action, In code you see a series of calls
delegating work to another class, why resembling $a->b()->c()->d()
does it exist at all?
Comments Duplicate Code
Dispensables
A dispensable is something pointless and
A method is filled with explanatory Two code fragments look almost
unneeded whose absence would make
comments. identical.
the code cleaner, more efficient and
easier to understand.
Data Class
Lazy Class