java包循环检测:如何找到涉及的具体类? [英] java package cycle detection: how to find the specific classes involved?

查看:362
本文介绍了java包循环检测:如何找到涉及的具体类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您建议使用什么工具来检测 java包循环依赖

知道目标是显式列出检测到的 package cycle'

What tool would you recommend to detect java package cyclic dependencies,
knowing that the goal is to list explicitly the specific classes involved in the detected 'across-packages cycle' ?

我知道 JDepend ,但它们都无法列出循环包中涉及的类依赖。

指标有一个有趣的图形表示的循环,但又限于包

I know about classycle and JDepend , but they both fail to list the classes involved in a cyclic package dependency.
Metrics has an interesting graphical representation of cycles, but again limited to packages, and quite difficult to read sometime.

我累了得到一个:




每个中有xxx个类别

>

" you have a package cycle dependency between those 3 packages
you have xxx classes in each
good luck finding the right classes and break this cycle "

您知道任何需要执行额外步骤的工具实际上向你解释为什么循环被检测到(即'列出涉及的类')?

Do you know any tool that takes the extra step to actually explain to you why the cycle is detected (i.e. 'list the involved classes') ?

Riiight ...宣布结果的时间:

Riiight... Time to proclaim the results:

@ l7010.de谢谢你的努力。我会投票给你(当我有足够的代表),特别是对于CAP的答案...但CAP是死在水中,不再与我的日食兼容3.4。其余的是商业,我只寻找免费软件

@l7010.de thank you for the effort. I will vote you up (when I will have enough rep), especially for the 'CAP' answer... but CAP is dead in the water and no longer compatible with my eclipse 3.4. The rest is commercial and I look only for freeware

@ daniel6651谢谢你,但说,只有免费软件(对不起没有提到它在第一位) p>

@izb作为常用的findbugs用户(现在使用最新的1.3.5),我点击一下接受你的答案...如果你能解释给我什么选项激活findbug检测任何循环。该功能仅提及 0.8.7版本(查找新样式检测器,以找到类之间的循环依赖性'),我不能测试。

更新:现在,我有一个旧的findbugs配置文件,其中该选项不是活性。我仍然喜欢 CAD

@daniel6651 thank you but, as said, freeware only (sorry to not have mentioned it in the first place)

答案是...见

@izb as a frequent user of findbugs (using the latest 1.3.5 right now), I am one click away to accept your answer... if you could explain to me what option there is to activate for findbug to detect any cycle. That feature is only mentioned for the 0.8.7 version in passing (look for 'New Style detector to find circular dependencies between classes'), and I am not able to test it.
Update: works now, I had an old findbugs configuration file in which that option was not activated. I still like CAD though ;)

推荐答案

Findbug可以检测循环类依赖,还有一个eclipse插件。

Findbugs can detect circular class dependencies, and has an eclipse plugin too.

http://findbugs.sourceforge.net/

这篇关于java包循环检测:如何找到涉及的具体类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆