mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-140478 Relatively simple method is "too complex to analyze" (test-case added, actually was fixed in 97cdb4cdd5)
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -273,6 +273,7 @@ public class DataFlowInspectionTest extends DataFlowInspectionTestCase {
|
||||
public void testManySequentialIfsNotComplex() { doTest(); }
|
||||
public void testManySequentialInstanceofsNotComplex() { doTest(); }
|
||||
public void testLongDisjunctionsNotComplex() { doTest(); }
|
||||
public void testManyDistinctPairsNotComplex() { doTest(); }
|
||||
public void testWhileNotComplex() { doTest(); }
|
||||
public void testAssertTrueNotComplex() { doTest(); }
|
||||
public void testAssertThrowsAssertionError() { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user