I am using javancss to detect CCN of methods. There are methods in our source code with values varying from 1 to 35 (are are even large).
Is there any guide line on what could be realistic limit? The article here gives some ideas -- http://java-metrics.com/cyclomatic-complexity/cyclomatic-complexity-what-is-it-and-why-should-you-care
I am thinking of 10 as soft limit and 15 as hard limit.. Main reason is that testing gets complicated with larger values..
I would like to hear from SO community..
I have two methods I use:
Another method to use is to be very rigorous when fixing bugs - check back with source control to see which methods changed to fix the bug. Refactor those methods to reduce their complexity.