File path: /jfreechart-1.0.10/src/org/jfree/data/statistics/HistogramDataset.java | File path: /jfreechart-1.0.10/src/org/jfree/data/statistics/HistogramDataset.java | |||
Method name: double getMinimum(double[])
|
Method name: double getMaximum(double[])
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | if (values == null || values.length < 1) {↵ | 1 | if (values == null || values.length < 1) {↵ | |
2 | throw new IllegalArgumentException(↵ | 2 | throw new IllegalArgumentException(↵ | |
3 | "Null or zero length 'values' argument.");↵ | 3 | "Null or zero length 'values' argument.");↵ | |
4 | }↵ | 4 | }↵ | |
5 | double min = Double.MAX_VALUE;↵ | 5 | double max = -Double.MAX_VALUE;↵ | |
6 | for (int i = 0; i < values.length; i++) {↵ | 6 | for (int i = 0; i < values.length; i++) {↵ | |
7 | if (values[i] < min) {↵ | 7 | if (values[i] > max) {↵ | |
8 | min = values[i];↵ | 8 | max = values[i];↵ | |
9 | }↵ | 9 | }↵ | |
10 | }↵ | 10 | }↵ | |
11 | return min; | 11 | return max; | |
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 13 |
Number of mapped statements | 7 |
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) | 2.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (values == null || values.length < 1) | 1 | if (values == null || values.length < 1) | ||||||||||||||||
2 | throw new IllegalArgumentException("Null or zero length 'values' argument."); | 2 | throw new IllegalArgumentException("Null or zero length 'values' argument."); | ||||||||||||||||
3 | double min = Double.MAX_VALUE; |
| 3 | double max = -Double.MAX_VALUE; | |||||||||||||||
4 | for (int i = 0; i < values.length; i++) | 4 | for (int i = 0; i < values.length; i++) | ||||||||||||||||
5 | if (values[i] < min) |
| 5 | if (values[i] > max) | |||||||||||||||
6 | min = values[i]; |
| 6 | max = values[i]; | |||||||||||||||
7 | return min; |
| 7 | return max; |
Row | Violation |
---|---|
1 | Expression values[i] < min cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression values[i] > max cannot be parameterized, because it has dependencies to/from statements that will be extracted |