Java Code Structure and Dependencies Analysis Tools for Eclipse
One of my first assignments at the new company (remember, I left Zend previous week), was analysing existing projects structure. Which means distribution of classes into packages, package dependencies, libraries usage etc.
The results, I would say, were far from being perfect, but I can bet, most of large (and especially proprietary) projects would look similar or even worse. But this is not what I was going to say.
What I am going to say, is for this purpose I evaluated several analysis tools and I want to share my opinion about them.
Here they are (in order of evaluation).
1. Eclipse Metrics(1) (CPL)
Pros: Runs fast, provides tangle detector.
Cons: Dependencies graph is not usable with large projects. No text output of dependencies is available.
2. Eclipse Metrics(2) (CPL)
Cons: Does not analyze dependencies.
Pros: Nice and simple UI, fast analysis.
Cons: Provides neither graph nor detailed dependency cycles information, doesn’t provide links to source.
3. eDepend (Commercial)
Pros: full featured graphic dependency analyzer, allows filtering on dependency kind
Cons: Commercial, creates disproportedly wide graphs for large projects that are hard to maintain, very slow analyzing and graph creation, doesn’t provide info on elements which depend on selected element.
4. stan4j (Free Beta)
Pros: Full featured graphic dependency analyzer, very cute GEF based UI, cycles and tangles visualizer, very convenient eclipse integration, report/graphics export ability.
Cons: Does not provide recursive dependency paths on selected elements, does not provide inter-package class dependencies information, non graphical views improvement is suggested.
In the end, in order to perform my task I’ve mostly used stan4j, sometimes switched to eDepend
and once or twice times executed JDepend – each of them has its specific advantages.