File path: /jfreechart-1.0.10/tests/org/jfree/data/statistics/junit/BoxAndWhiskerCalculatorTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/data/statistics/junit/BoxAndWhiskerCalculatorTests.java | |||
Method name: void testCalculateQ1()
|
Method name: void testCalculateQ3()
|
|||
Number of AST nodes: 19 | Number of AST nodes: 19 | |||
1 | boolean pass = false;↵ | 1 | boolean pass = false;↵ | |
2 | try {↵ | 2 | try {↵ | |
3 | BoxAndWhiskerCalculator.calculateQ1(null);↵ | 3 | BoxAndWhiskerCalculator.calculateQ3(null);↵ | |
4 | }↵ | 4 | }↵ | |
5 | catch (IllegalArgumentException e) {↵ | 5 | catch (IllegalArgumentException e) {↵ | |
6 | pass = true;↵ | 6 | pass = true;↵ | |
7 | }↵ | 7 | }↵ | |
8 | assertTrue(pass);↵ | 8 | assertTrue(pass);↵ | |
9 | ↵ | |||
10 | List values = new ArrayList();↵ | 9 | List values = new ArrayList();↵ | |
11 | double q1 = BoxAndWhiskerCalculator.calculateQ1(values);↵ | 10 | double q3 = BoxAndWhiskerCalculator.calculateQ3(values);↵ | |
12 | assertTrue(Double.isNaN(q1));↵ | 11 | assertTrue(Double.isNaN(q3));↵ | |
13 | values.add(new Double(1.0));↵ | 12 | values.add(new Double(1.0));↵ | |
14 | q1 = BoxAndWhiskerCalculator.calculateQ1(values);↵ | 13 | q3 = BoxAndWhiskerCalculator.calculateQ3(values);↵ | |
15 | assertEquals(q1, 1.0, EPSILON);↵ | 14 | assertEquals(q3, 1.0, EPSILON);↵ | |
16 | values.add(new Double(2.0));↵ | 15 | values.add(new Double(2.0));↵ | |
17 | q1 = BoxAndWhiskerCalculator.calculateQ1(values);↵ | 16 | q3 = BoxAndWhiskerCalculator.calculateQ3(values);↵ | |
18 | assertEquals(q1, 1.0, EPSILON);↵ | 17 | assertEquals(q3, 2.0, EPSILON);↵ | |
19 | values.add(new Double(3.0));↵ | 18 | values.add(new Double(3.0));↵ | |
20 | q1 = BoxAndWhiskerCalculator.calculateQ1(values);↵ | 19 | q3 = BoxAndWhiskerCalculator.calculateQ3(values);↵ | |
21 | assertEquals(q1, 1.5, EPSILON);↵ | 20 | assertEquals(q3, 2.5, EPSILON);↵ | |
22 | values.add(new Double(4.0));↵ | 21 | values.add(new Double(4.0));↵ | |
23 | q1 = BoxAndWhiskerCalculator.calculateQ1(values);↵ | 22 | q3 = BoxAndWhiskerCalculator.calculateQ3(values);↵ | |
24 | assertEquals(q1, 1.5, EPSILON); | 23 | assertEquals(q3, 3.5, EPSILON); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 173 |
Number of mapped statements | 19 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 60.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | boolean pass = false; | 1 | boolean pass = false; | ||||||||||||||||
2 | try | 2 | try | ||||||||||||||||
3 | BoxAndWhiskerCalculator.calculateQ1(null); |
| 3 | BoxAndWhiskerCalculator.calculateQ3(null); | |||||||||||||||
4 | assertTrue(pass); | 4 | assertTrue(pass); | ||||||||||||||||
5 | List values = new ArrayList(); | 5 | List values = new ArrayList(); | ||||||||||||||||
6 | double q1 = BoxAndWhiskerCalculator.calculateQ1(values); |
| 6 | double q3 = BoxAndWhiskerCalculator.calculateQ3(values); | |||||||||||||||
7 | assertTrue(Double.isNaN(q1)); |
| 7 | assertTrue(Double.isNaN(q3)); | |||||||||||||||
8 | values.add(new Double(1.0)); | 8 | values.add(new Double(1.0)); | ||||||||||||||||
9 | q1 = BoxAndWhiskerCalculator.calculateQ1(values); |
| 9 | q3 = BoxAndWhiskerCalculator.calculateQ3(values); | |||||||||||||||
10 | assertEquals(q1, 1.0, EPSILON); |
| 10 | assertEquals(q3, 1.0, EPSILON); | |||||||||||||||
11 | values.add(new Double(2.0)); | 11 | values.add(new Double(2.0)); | ||||||||||||||||
12 | q1 = BoxAndWhiskerCalculator.calculateQ1(values); |
| 12 | q3 = BoxAndWhiskerCalculator.calculateQ3(values); | |||||||||||||||
13 | assertEquals(q1, 1.0, EPSILON); |
| 13 | assertEquals(q3, 2.0, EPSILON); | |||||||||||||||
14 | values.add(new Double(3.0)); | 14 | values.add(new Double(3.0)); | ||||||||||||||||
15 | q1 = BoxAndWhiskerCalculator.calculateQ1(values); |
| 15 | q3 = BoxAndWhiskerCalculator.calculateQ3(values); | |||||||||||||||
16 | assertEquals(q1, 1.5, EPSILON); |
| 16 | assertEquals(q3, 2.5, EPSILON); | |||||||||||||||
17 | values.add(new Double(4.0)); | 17 | values.add(new Double(4.0)); | ||||||||||||||||
18 | q1 = BoxAndWhiskerCalculator.calculateQ1(values); |
| 18 | q3 = BoxAndWhiskerCalculator.calculateQ3(values); | |||||||||||||||
19 | assertEquals(q1, 1.5, EPSILON); |
| 19 | assertEquals(q3, 3.5, EPSILON); |
Row | Violation |
---|---|
1 | Expression BoxAndWhiskerCalculator.calculateQ1(null) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
2 | Expression BoxAndWhiskerCalculator.calculateQ3(null) is a method call throwing exception(s) that should be caught by a try block that will be extracted |
3 | Expression BoxAndWhiskerCalculator.calculateQ1(null) is a void method call, and thus it cannot be parameterized |
4 | Expression BoxAndWhiskerCalculator.calculateQ3(null) is a void method call, and thus it cannot be parameterized |
5 | Expression BoxAndWhiskerCalculator.calculateQ1(values) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression BoxAndWhiskerCalculator.calculateQ3(values) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression BoxAndWhiskerCalculator.calculateQ1(values) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression BoxAndWhiskerCalculator.calculateQ3(values) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression BoxAndWhiskerCalculator.calculateQ1(values) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression BoxAndWhiskerCalculator.calculateQ3(values) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression BoxAndWhiskerCalculator.calculateQ1(values) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression BoxAndWhiskerCalculator.calculateQ3(values) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression BoxAndWhiskerCalculator.calculateQ1(values) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression BoxAndWhiskerCalculator.calculateQ3(values) cannot be parameterized, because it has dependencies to/from statements that will be extracted |