forked from phoedos/pmd
Fix test
This commit is contained in:
@ -348,6 +348,95 @@
|
||||
}
|
||||
}
|
||||
|
||||
public void example1() {
|
||||
if (a && b || b && d) {
|
||||
if (y == z) {
|
||||
x = 2;
|
||||
} else if (y == t && !d) {
|
||||
x = 2;
|
||||
} else {
|
||||
x = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void example2() {
|
||||
if (c && d) {
|
||||
while (z < y) {
|
||||
x = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void example12() {
|
||||
if (a && b || b && d) {
|
||||
if (y == z) {
|
||||
x = 2;
|
||||
} else if (y == t && !d) {
|
||||
x = 2;
|
||||
} else {
|
||||
x = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void example22() {
|
||||
if (c && d) {
|
||||
while (z < y) {
|
||||
x = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void example3() {
|
||||
if (a && !b) {
|
||||
for (int n = 0; n < t; n++) {
|
||||
x = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void example32() {
|
||||
if (a && !b) {
|
||||
for (int n = 0; n < t; n++) {
|
||||
x = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void example4() {
|
||||
switch (x) {
|
||||
case 1:
|
||||
x = 2;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 3:
|
||||
x = 2;
|
||||
break;
|
||||
|
||||
default:
|
||||
x = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void example42() {
|
||||
switch (x) {
|
||||
case 1:
|
||||
x = 2;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 3:
|
||||
x = 2;
|
||||
break;
|
||||
|
||||
default:
|
||||
x = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</code-fragment>
|
||||
@ -357,7 +446,7 @@
|
||||
<description>Test many unreported methods</description>
|
||||
<expected-problems>1</expected-problems>
|
||||
<expected-messages>
|
||||
<message>The class 'Complicated' has a total cyclomatic complexity of 40 (highest 8).</message>
|
||||
<message>The class 'Complicated' has a total cyclomatic complexity of 80 (highest 8).</message>
|
||||
</expected-messages>
|
||||
<code-ref id="many-small-methods"/>
|
||||
</test-code>
|
||||
|
Reference in New Issue
Block a user