File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CyclicNumberAxis.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CyclicNumberAxis.java | |||
Method name: double valueToJava2D(double, Rectangle2D, RectangleEdge)
|
Method name: double valueToJava2D(double, Rectangle2D, RectangleEdge)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | if (value == vp) {↵ | 1 | if (value == vp) {↵ | |
2 | return this.boundMappedToLastCycle ? jmin : jmax; ↵ | 2 | return this.boundMappedToLastCycle ? jmax : jmin; ↵ | |
3 | }↵ | 3 | }↵ | |
4 | else if (value > vp) {↵ | 4 | else if (value >= vp) {↵ | |
5 | return jmax - (value - vp) * (jmax - jmin) / this.period;↵ | 5 | return jmin + (value - vp) * (jmax - jmin) / this.period;↵ | |
6 | } ↵ | 6 | } ↵ | |
7 | else {↵ | 7 | else {↵ | |
8 | return jmin + (vp - value) * (jmax - jmin) / this.period;↵ | 8 | return jmax - (vp - value) * (jmax - jmin) / this.period;↵ | |
9 | } | 9 |
| |
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.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 13 |
Number of mapped statements | 5 |
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) | 4.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
16 | if (value == vp) | 21 | if (value == vp) | ||||||||||||||||
17 | return this.boundMappedToLastCycle ? jmin : jmax; |
| 22 | return this.boundMappedToLastCycle ? jmax : jmin; | |||||||||||||||
18 | else if (value > vp) |
| 23 | else if (value >= vp) | |||||||||||||||
19 | return jmax - (value - vp) * (jmax - jmin) / this.period; |
| 24 | return jmin + (value - vp) * (jmax - jmin) / this.period; | |||||||||||||||
else | else | ||||||||||||||||||
20 | return jmin + (vp - value) * (jmax - jmin) / this.period; |
| 25 | return jmax - (vp - value) * (jmax - jmin) / this.period; |
Row | Violation |
---|---|
1 | Expression value > vp cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression value >= vp cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression jmax - (value - vp) * (jmax - jmin) / this.period cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression jmin + (value - vp) * (jmax - jmin) / this.period cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression jmin + (vp - value) * (jmax - jmin) / this.period cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression jmax - (vp - value) * (jmax - jmin) / this.period cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Not all possible execution flows end in a return statement |