KEMBAR78
Code Refactoring Cheatsheet | PDF
Refactoring Techniques
Composing Methods
Extract Method
Inline Method
Extract Variable
Inline Temp
Replace Temp with Query
Replace Method with Method Object
Split Temporary Variable
Remove Assignments to Parameters
Substitute Algorithm
Moving Features between Objects
Move Method
Move Field
Extract Class
Inline Class
Hide Delegate
Remove Middleman
Introduce Foreign Method
Introduce Local Extension
Organizing Data
Self-Encapsulate Field
Encapsulate Field
Change Value to Reference
Change Reference to Value
Replace Data Value with Object
Replace Array with Object
Encapsulate Collection
Change Unidirectional Association to Bidirectional
Change Bidirectional Association to Unidirectional
Replace Magic Number with Symbolic Constant
Duplicate Observed Data
Replace Type Code with Class
Replace Type Code with Subclasses
Replace Type Code with State/Strategy
Replace Subclass with Fields
Simplifying Conditional Expressions
Decompose Conditional
Consolidate Conditional Expression
Consolidate Duplicate Conditional Fragments
Remove Control Flag
Replace Nested Conditional with Guard Clauses
Introduce Assertion
Replace Conditional with Polymorphism
Introduce Null Object
Simplifying Method Calls
Rename Method
Add Parameter
Remove Unused Parameter
Separate Query from Modifier
Parameterize Method
Preserve Whole Object
Replace Parameter with Method Call
Replace Parameter with Explicit Methods
Introduce Parameter Object
Remove Setting Method for Immutable Fields
Hide Method that should not be Public
Replace Constructor with Factory Method
Replace Error Code with Exception
Replace Exception with Test
Dealing with Generalization
Pull Up Field
Pull Up Method
Pull Up Constructor Body
Push Down Field
Push Down Method
Extract Subclass
Extract Superclass
Collapse Hierarchy
Extract Interface
Form Template Method
Replace Inheritance with Delegation
Replace Delegation with Inheritance

Code Refactoring Cheatsheet