java圈复杂度工具使用完全限定的类名
大多数 javancss 工具使用源代码中给出的方法参数。变量名称被删除,但类名称不是 FQN。
例如,给出以下课程。
import java.io.File;
public class Demo {
public void show ( java.io.File file) {
//do some thing with file..
}
public void show2(File win) {
//do some thing with win
}
}
Javancss 生成输出
Nr. NCSS CCN JVDC Function
1 1 1 0 Demo.show(java.io.File)
2 1 1 0 Demo.show2(File)
Average Function NCSS: 1.00
Average Function CCN: 1.00
Average Function JVDC: 0.00
Program NCSS: 4.00
请注意,show2 仅附带 File,而不是 java.io.File 对于我的处理,我需要完全限定的名称。有没有可以在报告中输出 FQN 的 ncss 工具? (我尝试了cobertura内置的javacss和checkstyle..所有行为都相同)
编辑(背景) 我们现在为每种方法创建 cobertuta 覆盖率报告。我们想要有关高复杂性和较低覆盖率的方法的报告。当我尝试映射方法的CCN时,上述情况造成了一些困难。通过仅比较类名而不是 FQN 来(部分)解决了这个问题。
Most javancss tools use the method arguments as given in source code. The variable names are removed, but the class names are not FQN.
For example, given following class.
import java.io.File;
public class Demo {
public void show ( java.io.File file) {
//do some thing with file..
}
public void show2(File win) {
//do some thing with win
}
}
Javancss produce output
Nr. NCSS CCN JVDC Function
1 1 1 0 Demo.show(java.io.File)
2 1 1 0 Demo.show2(File)
Average Function NCSS: 1.00
Average Function CCN: 1.00
Average Function JVDC: 0.00
Program NCSS: 4.00
Note that the show2 comes with just File, not java.io.File
For my proeccessing, I require fully qualified names. Is there any ncss tools that could output FQN in reports? (I tried cobertura's built in javacss and checkstyle.. all behaves the same way)
Edit (background)
We now create cobertuta coverage report for each method. We want report on methods with high complexity and lower coverage. When I tried to map CCN of method, the above case caused some difficulty. It was (partially) solved by comparing only the class names not FQN.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

你看过CyVis吗?从屏幕截图来看,它似乎使用了完全限定的名称。
Have you looked at CyVis? From the screenshots it appears to use fully qualified names.