在Java中自动计算圈复杂度的工具? [英] Tools to automate calculation of cyclomatic complexity in java?
问题描述
是否有可用于Java的工具,可以自动确定给定Java代码的循环复杂性?我已经在网上找到了工具,但尚未找到。
Are there any tools available for Java that can automagically determine the cyclomatic complexity of given Java code? I have sought out tools online, and have yet to find one.
推荐答案
我使用Sonar(我的首选方法)。有一些插件可以在构建时自动生成报告(即ANT / Maven等)。
I use Sonar (my preferred method). There are plugins to "automagically" generate the report at build time (i.e. ANT/Maven, etc...).
另一篇有关如何在仪表板上显示抄送的相关文章:如何列出最复杂的方法
Another related post on how to show the CC on the dashboard: how to list methods with most cyclomatic complexity
我过去使用的另一个工具是Corbetura。不过,您必须具有良好的单元测试,并且发现CC的定量分析有些棘手。
One other tool I've used in the past is corbetura. You have to have good unit tests though and finding the quantitative analysis for CC is a little tricky.
这篇关于在Java中自动计算圈复杂度的工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!