Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a lightweight Java code metrics analyser that I can run in eclipse with Maven, Jenkins/Hudson?

I know about Sonar but I'd rather not (actually, can't) run a whole web app that says it likes 500Mb of ram just to run some reports on a build. I've already got Checkstyle, FindBugs & PMD - can I configure them for the kind of metrics I'm looking for ... method length, class length, mccabe etc.? I'd also like to see (in jenkins) graphing of these over time.

Any ideas?

like image 894
blank Avatar asked Jun 22 '11 19:06

blank


3 Answers

Crap4J offers cyclomatic complexity and, of course, CRAP.

like image 83
Michael Brewer-Davis Avatar answered Oct 08 '22 15:10

Michael Brewer-Davis


eclipse-cs is a checkstyle plug-in for eclipse which can report on your custom checkstyle file. This can be used to setup metric checking for method length, class length, cyclomatic complexity and much more. I always run my eclipse setup with this enabled as it gives great real-time metrics.

PMD, checkstyle and findbugs all offer trending reports in their plugins for your Hudson/Jenkins build process to see trending over time. It should be an option near the bottom of your configuration on your build.

like image 33
Chris Knight Avatar answered Oct 08 '22 15:10

Chris Knight


There's a JavaNCSS Maven plugin that does a lot of metrics stuff.

There's a Jenkins plugin that's supposed to generate graphs for visualization, but I was never able to get it to work.

BTW, you can also check out the core JavaNCSS tool.

like image 44
Spanky Quigman Avatar answered Oct 08 '22 16:10

Spanky Quigman