Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tools to automate calculation of cyclomatic complexity in java?

Are there any tools available for Java that can automagically determine the cyclomatic complexity of given Java code? I have sought out tools online, and have yet to find one.

like image 867
mjgpy3 Avatar asked Sep 10 '12 16:09

mjgpy3


1 Answers

I use Sonar (my preferred method). There are plugins to "automagically" generate the report at build time (i.e. ANT/Maven, etc...).

Another related post on how to show the CC on the dashboard: how to list methods with most cyclomatic complexity

One other tool I've used in the past is corbetura. You have to have good unit tests though and finding the quantitative analysis for CC is a little tricky.

like image 59
Domenic D. Avatar answered Oct 02 '22 06:10

Domenic D.