In the previous articles in this series we’ve seen:
In this article we’ll see how to identify the Brain Method code smell.
Brain Method Detection Strategy
Brain Methods are methods that centralize the intelligence of a class. Object-Oriented Metrics in Practice, by Michele Lanza and Radu Marinescu, proposes the following detection strategy for Brain Methods:
(LOC > HighLocForClass/2) AND (CYCLO >= High) AND (MAXNESTING >= Several) AND (NOAV > Many)