Domanda

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.

È stato utile?

Soluzione

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.

Altri suggerimenti

One of the metrics produced by Sonar is Cyclomatic Complexity.
I believe it also has an Eclipse plugin (but I haven't managed to find it yet)

AgitarOne from Agitar Technologies (http://www.agitar.com/solutions/products/agitarone.html) calculates cyclomatic complexity in their dashboard report and with their code rules plugin in Eclipse. Note also that McCabe IQ from McCabe Software (http://www.mccabe.com), a sister company of Agitar Technologies, also calculates cyclomatic complexity (aka McCabe complexity) for Java and has an Eclipse plugin for project setup.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top