IDEA-140478 Relatively simple method is "too complex to analyze" (test-case added, actually was fixed in 97cdb4cdd5)

This commit is contained in:
Tagir Valeev
2017-03-16 11:47:35 +07:00
parent 55466aeef1
commit 22a28fd2cc
2 changed files with 33 additions and 1 deletions
@@ -0,0 +1,31 @@
public class ManyDistinctPairsNotComplex {
enum SquareType {
BLACKROOK, BLACKKNIGHT, BLACKBISHOP, BLACKKING, BLACKQUEEN, BLACKPAWN
}
private SquareType[][] squares;
private int WIDTH;
private int HEIGHT;
public void blackStartPos() {
for (int row = 0; row < HEIGHT; row++) {
for (int col = 0; col < WIDTH; col++) {
if (row == 6) {
squares[row][col] = SquareType.BLACKPAWN;
} else if (row == 7 && (col == 0 || col == 7)) {
squares[row][col] = SquareType.BLACKROOK;
} else if (row == 7 && (col == 1 || col == 6)) {
squares[row][col] = SquareType.BLACKKNIGHT;
} else if (row == 7 && (col == 2 || col == 5)) {
squares[row][col] = SquareType.BLACKBISHOP;
} else if (row == 7 && col == 3) {
squares[row][col] = SquareType.BLACKKING;
} else if (row == 7 && col == 4) {
squares[row][col] = SquareType.BLACKQUEEN;
} else if (<warning descr="Condition 'row == 7 && col == 2' is always 'false'">row == 7 && <warning descr="Condition 'col == 2' is always 'false' when reached">col == 2</warning></warning>) {
System.out.println("Impossible");
}
}
}
}
}