How to get Java source code dependency metrics?

For the assignment, we need to extract some programmatic metrics from the Hibernate project. We must extract afferent connections and efferent communication metrics (dependency fan, fan) from each revision of each package in Hibernate. Some tools were provided that could extract these metrics, such as ckjm and JDepend . Other tools I tested were Sonar , javancss and AOP . There is also a Metrics Eclipse plugin, which I did not work with either.

What I have in common with these tools is that they all work with bytecode (* .class files). This is a problem because I have to build each revision from the source code in order to run, say, JDepend. Older versions will not be created because my development stack is too large. I would like to do such an analysis in the source files so that I do not have to create each revision. Is it possible? Or is there a good reason why all of these tools work only in bytecode?

+3
source share
5 answers
+1

, cccc (LOC, McCabe , CK HK). , , Hibernate- . , , .

script, . , Java, , .

0

, ( ) , Java.

DMS Software Reengineering Toolkit Java Front End Java 1.6. ( 1.7, , ). AST . DMS / AST .

DMS , .

0

Check out the Sonar . This is a standalone open source web service to which you "submit" your code, and it creates beautiful HTML reports for all types of code metrics. It also stores assembly history. And, most importantly, you do not need to change your builds or pumps!

For him, too, is the purpose of the maven: sonar:sonar. Jenkins (formerly Hudson) has a plugin for it, so it is completely painless if you use it for your CI.

Check it out - you won’t regret it!

0
source

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


All Articles