Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Refactoring map

For major code smells you will quickly find associated refactoring techniques

class
Is doing the work of several
Expression 
hard to understand
Variables

Temporary variable assigning the result of a simple expression

methods
Long method
Too Many responsibilities in a single method
And in method name
parameters
a value is assigned to a parameter inside a method body
Chaining calls between objects
(law of demeter)
too many methods that delegates to other objects
expressions
multiple conditionals leading to the same result
identical code in all branches
very complex conditional
performs various actions depending on object type or properties
its name does not explain what the method does
unused method parameter
method that returns a value and changes internal state
methods contain a repeating group of parameters
constructor doing more than setting parameters
have the same fields / methods
several classes...
are using the same part of a class interface

Journey proposed by Yoan Thirion #sharingiscaring