File path: /jfreechart-1.0.10/src/org/jfree/data/DataUtilities.java | File path: /jfreechart-1.0.10/src/org/jfree/data/DataUtilities.java | |||
Method name: double calculateColumnTotal(Values2D, int)
|
Method name: double calculateRowTotal(Values2D, int)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | double total = 0.0;↵ | 1 | double total = 0.0;↵ | |
2 | int rowCount = data.getRowCount();↵ | 2 | int columnCount = data.getColumnCount();↵ | |
3 | for (int r = 0; r < rowCount; r++) {↵ | 3 | for (int c = 0; c < columnCount; c++) {↵ | |
4 | Number n = data.getValue(r, column);↵ | 4 | Number n = data.getValue(row, c);↵ | |
5 | if (n != null) {↵ | 5 | if (n != null) {↵ | |
6 | total += n.doubleValue(); ↵ | 6 | total += n.doubleValue(); ↵ | |
7 | }↵ | 7 | }↵ | |
8 | }↵ | 8 | }↵ | |
9 | return total; | 9 |
| |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 17 |
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.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | double total = 0.0; | 1 | double total = 0.0; | ||||||||||||||||||||||
2 | int rowCount = data.getRowCount(); |
| 2 | int columnCount = data.getColumnCount(); | |||||||||||||||||||||
3 | for (int r = 0; r < rowCount; r++) |
| 3 | for (int c = 0; c < columnCount; c++) | |||||||||||||||||||||
4 | Number n = data.getValue(r, column); |
| 4 | Number n = data.getValue(row, c); | |||||||||||||||||||||
5 | if (n != null) | 5 | if (n != null) | ||||||||||||||||||||||
6 | total += n.doubleValue(); | 6 | total += n.doubleValue(); | ||||||||||||||||||||||
7 | return total; | 7 | return total; |
Row | Violation |
---|---|
1 | Expression r cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression c cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression r cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression c cannot be parameterized, because it has dependencies to/from statements that will be extracted |