This commit is contained in:
oowekyala
2017-08-13 18:42:46 +02:00
parent 5bd2fc1382
commit abc70c6cf6

View File

@ -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>