Trends and quality characteristics of Java code (LOC, methods, etc.)

I recently included Junit and Emma in CruiseControl (CC), so it generates good reports for every build. I would like to see some trending charts based on some information that Emma gives as% coverage numbers and a summary:

OVERALL STATS SUMMARY total packages: 54 total executable files: 1001 total classes: 1133 total methods: 11814 total executable lines: 112428 

Ideally, we can have one page on which there are graphs (Google charts?), Each of which is updated every assembly. I searched a little Google and it looks like there is a jenkins plugin that could do this, but I have not seen anything like this for CC. I also plan to get Sonar and run in CC too, maybe Sonar does this?

I could, of course, write my own code for creating trending charts (doesn't seem too complicated for parsing emma output and creating a chart page), but I would prefer not to reinvent the wheel.

Ah - just found this: β€œAnother approach is to use the Sonar plugin for Hudson to maintain the trend of coverage over time” in Can my build anticipate that my code coverage never worsens? I could install Hudson and use this instead of CC, but would prefer if I didn't have to.

So - my question is - what is the easiest way to get trend coverage / statistics for my java code (hopefully in CruiseControl)?

+4
source share
1 answer

Using the Sonar Hudson / Jenkins plugin is certainly not required to perform Sonar analysis. You can invoke Sonar from any tool (command line, CI tool such as CC, ... etc.).

You just need to provide some information to Sonar, maybe it is in the POM if you use Maven, in the build.xml file, if you use Ant, in "sonar-project.properties" if you plan to use a simple Sonar Runner or just pass properties if you use Jenkins / Hudson.

Check out our documentation on the different ways to call Sonar to learn more about all this.

+2
source

Source: https://habr.com/ru/post/1437433/


All Articles