There are few symptoms to look for which can point out if any code needs healing:
Application is Fragile - small change leads to bigger regression.Application is Rigid - hard to make any small change without impacting other parts.
Application is Immobile - hard to reuse code due to interdependencies.
How to discover the code which smells?
- Classes with too many instance variables, methods and code.
- Single class/methods performing too many things
- Too much comments to explain the code instead of following proper naming conventions.
- Deeply nested switch/case or if/else statements.
- Duplicate code exists in different places.
- Over use of implementation inheritance.
- Unnecessary use of design patterns