The good folks at Agitar have proposed a new metric, C.R.A.P and an Eclipse plugin crap4j for executing it.
C.R.A.P. combines a method’s complexity with its coverage to come up with a single number that can help you determine if somebody will say,“Oh crap!” when they have to work with it. The formula is:
CRAP(m) = comp(m)^2 * (1 – cov(m)/100)^3 + comp(m)
Read their article for details on deciding if a system is crappy or not.
To test the flexibility of Panopticode I decided to implement a C.R.A.P. Supplement. It took a little over an hour.
Looking at the results I was pleased to find that only one method in Panopticode exceeds Agitar’s C.R.A.P. threshold of 30. Unfortunately that leads me to believe that 30 is too high. Right now, there is a lot of spike code in Panopticode right now that I consider crappy ;->