File path: /jfreechart-1.0.10/src/org/jfree/data/statistics/BoxAndWhiskerCalculator.java | File path: /jfreechart-1.0.10/src/org/jfree/data/statistics/BoxAndWhiskerCalculator.java | |||
Method name: double calculateQ1(List)
|
Method name: double calculateQ3(List)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | if (count > 0) {↵ | 1 | if (count > 0) {↵ | |
2 | if (count % 2 == 1) {↵ | 2 | if (count % 2 == 1) {↵ | |
3 | if (count > 1) {↵ | 3 | if (count > 1) {↵ | |
4 | result = Statistics.calculateMedian(values, 0, count / 2↵ | 4 | result = Statistics.calculateMedian(values, count / 2, ↵ | |
5 | );↵ | 5 | count - 1);↵ | |
6 | }↵ | 6 | }↵ | |
7 | else {↵ | 7 | else {↵ | |
8 | result = Statistics.calculateMedian(values, 0, 0);↵ | 8 | result = Statistics.calculateMedian(values, 0, 0);↵ | |
9 | }↵ | 9 | }↵ | |
10 | }↵ | 10 | }↵ | |
11 | else {↵ | 11 | else {↵ | |
12 | result = Statistics.calculateMedian(values, 0, count / 2 - 1);↵ | 12 | result = Statistics.calculateMedian(values, count / 2, ↵ | |
13 | }↵ | 13 | count - 1);↵ | |
14 | ↵ | 14 | }↵ | |
15 | } | 15 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 14 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | if (count > 0) | 5 | if (count > 0) | ||||||||||||||||
6 | if (count % 2 == 1) | 6 | if (count % 2 == 1) | ||||||||||||||||
7 | if (count > 1) | 7 | if (count > 1) | ||||||||||||||||
|
| 8 | result = Statistics.calculateMedian(values, count / 2, count - 1); | ||||||||||||||||
8 | result = Statistics.calculateMedian(values, 0, count / 2); |
| | ||||||||||||||||
else | else | ||||||||||||||||||
9 | result = Statistics.calculateMedian(values, 0, 0); | 9 | result = Statistics.calculateMedian(values, 0, 0); | ||||||||||||||||
else | else | ||||||||||||||||||
10 | result = Statistics.calculateMedian(values, 0, count / 2 - 1); |
| 10 | result = Statistics.calculateMedian(values, count / 2, count - 1); |
Row | Violation |
---|---|
1 | Unmatched statement result=Statistics.calculateMedian(values,count / 2,count - 1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement result=Statistics.calculateMedian(values,0,count / 2); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Expression count / 2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression count / 2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |