for (int i = 0; i < data[0].length; i++) {
float v = data[0][i];
if (v < lowest) {
lowest = v;
}
if (v > highest) {
highest = v;
}
}
for (int i = 0; i < data[0].length; i++) {
float v = data[1][i];
if (v < lowest) {
lowest = v;
}
if (v > highest) {
highest = v;
}
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/FastScatterPlot.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/FastScatterPlot.java
|
Method name: Range calculateXDataRange(float[][])
|
|
Method name: Range calculateYDataRange(float[][])
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | for (int i = 0; i < data[0].length; i++) {↵ | | 1 | for (int i = 0; i < data[0].length; i++) {↵
|
2 | float v = data[0][i];↵ | | 2 | float v = data[1][i];↵
|
3 | if (v < lowest) {↵ | | 3 | if (v < lowest) {↵
|
4 | lowest = v;↵ | | 4 | lowest = v;↵
|
5 | }↵ | | 5 | }↵
|
6 | if (v > highest) {↵ | | 6 | if (v > highest) {↵
|
7 | highest = v;↵ | | 7 | highest = v;↵
|
8 | }↵ | | 8 | }↵
|
9 | } | | 9 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 18 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 0.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | for (int i = 0; i < data[0].length; i++) | | 5 | for (int i = 0; i < data[0].length; i++) |
6 | | | 6 | |
7 | | | 7 | |
8 | | | 8 | |
9 | | | 9 | |
10 | | | 10 | |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables lowest, highest , while Clone fragment #2 returns variables lowest, highest |