Code Smells
| Smell | Refactoring |
|---|---|
| Alternative Classes with Different Interfaces ( 43 ) [ F ] | Unify Interfaces with Adapter ( 247 ) |
| Combinatorial Explosion ( 45 ) | Replace Implicit Language with Interpreter ( 269 ) |
| Conditional Complexity ( 41 ) | Replace Conditional Logic with Strategy ( 129 )Move Embellishment to Decorator ( 144 )Replace State-Altering Conditionals with State ( 166 )Introduce Null Object ( 301 ) |
| Duplicated Code ( 39 ) [ F ] | Form Template Method ( 205 )Introduce Polymorphic Creation with Factory Method ( 88 )Chain Constructors ( 340 )Replace One/Many Distinctions with Composite ( 224 )Extract Composite ( 214 )Unify Interfaces with Adapter ( 247 )Introduce Null Object ( 301 ) |
| Indecent Exposure ( 42 ) | Encapsulate Classes with Factory ( 80 ) |
| Large Class ( 44 ) [ F ] | Replace Conditional Dispatcher with Command ( 191 )Replace State-Altering Conditionals with State ( 166 )Replace Implicit Language with Interpreter ( 269 ) |
| Lazy Class ( 43 ) [ F ] | Inline Singleton ( 114 ) |
| Long Method ( 40 ) [ F ] | Compose Method ( 123 )Move Accumulation to Collecting Parameter ( 313 )Replace Conditional Dispatcher with Command ( 191 )Move Accumulation to Visitor ( 320 )Replace Conditional Logic with Strategy ( 129 ) |
| Oddball Solution ( 45 ) | Unify Interfaces with Adapter ( 247 ) |
| Primitive Obsession ( 41 ) [ F ] | Replace Type Code with Class ( 286 )Replace State-Altering Conditionals with State ( 166 )Replace Conditional Logic with Strategy ( 129 )Replace Implicit Tree with Composite ( 178 )Replace Implicit Language with Interpreter ( 269 )Move Embellishment to Decorator ( 144 )Encapsulate Composite with Builder ( 96 ) |
| Solution Sprawl ( 43 ) | Move Creation Knowledge to Factory ( 68 ) |
| Switch Statements ( 44 ) [ F ] | Replace Conditional Dispatcher with Command ( 191 )Move Accumulation to Visitor ( 320 ) |
A Study Sequence
| Session | Refactoring(s) |
|---|---|
| 1 | Replace Constructors with Creation Methods ( 57 )Chain Constructors ( 340 ) |
| 2 | Encapsulate Classes with Factory ( 80 ) |
| 3 | Introduce Polymorphic Creation with Factory Method ( 88 ) |
| 4 | Replace Conditional Logic with Strategy ( 129 ) |
| 5 | Form Template Method ( 205 ) |
| 6 | Compose Method ( 123 ) |
| 7 | Replace Implicit Tree with Composite ( 178 ) |
| 8 | Encapsulate Composite with Builder ( 96 ) |
| 9 | Move Accumulation to Collecting Parameter ( 313 ) |
| 10 | Extract Composite ( 214 )Replace One/Many Distinctions with Composite ( 224 ) |
| 11 | Replace Conditional Dispatcher with Command ( 191 ) |
| 12 | Extract Adapter ( 258 )Unify Interfaces with Adapter ( 247 ) |
| 13 | Replace Type Code with Class ( 286 ) |
| 14 | Replace State-Altering Conditionals with State ( 166 ) |
| 15 | Introduce Null Object ( 301 ) |
| 16 | Inline Singleton ( 114 )Limit Instantiation with Singleton ( 296 ) |
| 17 | Replace Hard-Coded Notifications with Observer ( 236 ) |
| 18 | Move Embellishment to Decorator ( 144 )Unify Interfaces ( 343 )Extract Parameter ( 346 ) |
| 19 | Move Creation Knowledge to Factory ( 68 ) |
| 20 | Move Accumulation to Visitor ( 320 ) |
| 21 | Replace Implicit Language with Interpreter ( 269 ) |