lizard
lizard copied to clipboard
Fail to recognize the java anonymous class
Lizard can not recognize the anonymous class very well, and then adds the cyclomatic complexity of all functions in the anonymous class and calculates it in the cyclomatic complexity of the function where the anonymous class is located.
I think this is inaccurate.
For example, here is a demo java:
class Demo{
public void test() {
new Thread(new Runnable() {
@Override
public void run() {
if(true) {
System.out.println("Hello");
}
}
public void testA() {
if(true) {
System.out.println("World!");
}
}
}).start();
}
}
output is: 15,3,66,0,17,"Demo::test@4-20@/xxx/Demo.java","/xxx/Demo.java","Demo::test","Demo::test()",4,20