File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ModuloAxis.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ModuloAxis.java | |||
Method name: double transStart(double, Rectangle2D, RectangleEdge, double, double)
|
Method name: double transEnd(double, Rectangle2D, RectangleEdge, double, double)
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | double min = 0.0;↵ | 1 | double min = 0.0;↵ | |
2 | double max = 0.0;↵ | 2 | double max = 0.0;↵ | |
3 | if (RectangleEdge.isTopOrBottom(edge)) {↵ | 3 | if (RectangleEdge.isTopOrBottom(edge)) {↵ | |
4 | min = area.getX();↵ | 4 | max = area.getMaxX();↵ | |
5 | max = area.getX() + area.getWidth() * length1↵ | 5 | min = area.getMaxX() - area.getWidth() * length2 ↵ | |
6 | / (length1 + length2);↵ | 6 | / (length1 + length2);↵ | |
7 | }↵ | 7 | }↵ | |
8 | else if (RectangleEdge.isLeftOrRight(edge)) {↵ | 8 | else if (RectangleEdge.isLeftOrRight(edge)) {↵ | |
9 | min = area.getMaxY();↵ | 9 | max = area.getMinY();↵ | |
10 | max = area.getMaxY() - area.getHeight() * length1 ↵ | 10 | min = area.getMinY() + area.getHeight() * length2 ↵ | |
11 | / (length1 + length2);↵ | 11 | / (length1 + length2);↵ | |
12 | }↵ | 12 | }↵ | |
13 | if (isInverted()) {↵ | 13 | if (isInverted()) {↵ | |
14 | return max - ((value - this.displayStart) ↵ | 14 | return max - ((value - this.↵ | |
15 | fixedRange.getLowerBound()) ↵ | |||
15 | / (this.fixedRange.getUpperBound() - this.displayStart)) ↵ | 16 | / (this.displayEnd - this.fixedRange.getLowerBound())) ↵ | |
16 | * (max - min);↵ | 17 | * (max - min);↵ | |
17 | }↵ | 18 | }↵ | |
18 | else {↵ | 19 | else {↵ | |
19 | return min + ((value - this.displayStart) ↵ | 20 | return min + ((value - this.↵ | |
21 | fixedRange.getLowerBound()) ↵ | |||
20 | / (this.fixedRange.getUpperBound() - this.displayStart)) ↵ | 22 | / (this.displayEnd - this.fixedRange.getLowerBound())) ↵ | |
21 | * (max - min);↵ | 23 | * (max - min);↵ | |
22 | } | 24 |
| |
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 61 |
Number of mapped statements | 11 |
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) | 12.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | double min = 0.0; | 1 | double min = 0.0; | ||||||||||||||||||||||
2 | double max = 0.0; | 2 | double max = 0.0; | ||||||||||||||||||||||
3 | if (RectangleEdge.isTopOrBottom(edge)) | 3 | if (RectangleEdge.isTopOrBottom(edge)) | ||||||||||||||||||||||
4 | min = area.getX(); |
| 4 | max = area.getMaxX(); | |||||||||||||||||||||
5 | max = area.getX() + area.getWidth() * length1 / (length1 + length2); |
| 5 | min = area.getMaxX() - area.getWidth() * length2 / (length1 + length2); | |||||||||||||||||||||
6 | else if (RectangleEdge.isLeftOrRight(edge)) | 6 | else if (RectangleEdge.isLeftOrRight(edge)) | ||||||||||||||||||||||
7 | min = area.getMaxY(); |
| 7 | max = area.getMinY(); | |||||||||||||||||||||
8 | max = area.getMaxY() - area.getHeight() * length1 / (length1 + length2); |
| 8 | min = area.getMinY() + area.getHeight() * length2 / (length1 + length2); | |||||||||||||||||||||
9 | if (isInverted()) | 9 | if (isInverted()) | ||||||||||||||||||||||
10 | return max - ((value - this.displayStart) / (this.fixedRange.getUpperBound() - this.displayStart)) * (max - min); |
| 10 | return max - ((value - this.fixedRange.getLowerBound()) / (this.displayEnd - this.fixedRange.getLowerBound())) * (max - min); | |||||||||||||||||||||
else | else | ||||||||||||||||||||||||
11 | return min + ((value - this.displayStart) / (this.fixedRange.getUpperBound() - this.displayStart)) * (max - min); |
| 11 | return min + ((value - this.fixedRange.getLowerBound()) / (this.displayEnd - this.fixedRange.getLowerBound())) * (max - min); |
Row | Violation |
---|---|
1 | Expression min cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression max cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression max cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression min cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression min cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression max cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression max cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression min cannot be parameterized, because it has dependencies to/from statements that will be extracted |