Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any automated metrics collector for my Java project?

I'm trying to collect software code metrics in my Java project on every cycle of continuous integration. I'm interested mostly in size-related metrics like number of classes, number of methods, function points, lines of code, etc. I would like to get a summary report with these metrics in some XML file. Later I will use it in project report, or somehow else.

Is there any free open-source tool which I can integrate with Maven for this purpose?

like image 743
yegor256 Avatar asked Oct 26 '10 15:10

yegor256


People also ask

What is metrics in Java?

Metrics is a Java library which provides measuring instruments for Java applications. It has several modules, and in this article, we will elaborate metrics-core module, metrics-healthchecks module, metrics-servlets module, and metrics-servlet module, and sketch out the rest, for your reference.


3 Answers

One good option is Sonar.

Its primary purpose is to manage technical debt, so it does a lot of things you don't need, but it provides really good metrics.

You can integrate it with Hudson or whatever other continuous integration system you are using.

like image 76
Alan Geleynse Avatar answered Oct 12 '22 22:10

Alan Geleynse


Take a look at the javancss-maven-plugin.

JavaNCSS is a source measurement suite for Java which produces quantity & complexity metrics for your java source code.

This plugin provides the capability to run the JavaNCSS tool on your Maven 2 project sources and produce an html report. Optionally you can fail the build whenever one of the metrics goes beyond a fixed limit.

like image 31
matt b Avatar answered Oct 13 '22 00:10

matt b


I'll throw in XRadar which provides similar functionality to Sonar.

like image 34
Philipp Jardas Avatar answered Oct 13 '22 00:10

Philipp Jardas