File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/NumberAxis.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/NumberAxis.java | |||
Method name: List refreshTicksHorizontal(Graphics2D, Rectangle2D, RectangleEdge)
|
Method name: List refreshTicksVertical(Graphics2D, Rectangle2D, RectangleEdge)
|
|||
Number of AST nodes: 23 | Number of AST nodes: 24 | |||
1 | for (int i = 0; i < count; i++) {↵ | |||
2 | double currentTickValue = lowestTickValue + (i * size);↵ | 1 | double currentTickValue = lowestTickValue + (i * size);↵ | |
3 | String tickLabel;↵ | 2 | String tickLabel;↵ | |
4 | NumberFormat formatter = getNumberFormatOverride();↵ | 3 | NumberFormat formatter = getNumberFormatOverride();↵ | |
5 | if (formatter != null) {↵ | 4 | if (formatter != null) {↵ | |
6 | tickLabel = formatter.format(currentTickValue);↵ | 5 | tickLabel = formatter.format(currentTickValue);↵ | |
7 | }↵ | 6 | }↵ | |
8 | else {↵ | 7 | else {↵ | |
9 | tickLabel = getTickUnit().valueToString(currentTickValue);↵ | 8 | tickLabel = getTickUnit().valueToString(currentTickValue);↵ | |
10 | }↵ | 9 | }↵ | |
11 | TextAnchor anchor = null;↵ | 10 | TextAnchor anchor = null;↵ | |
12 | TextAnchor rotationAnchor = null;↵ | 11 | TextAnchor rotationAnchor = null;↵ | |
13 | double angle = 0.0;↵ | 12 | double angle = 0.0;↵ | |
14 | if (isVerticalTickLabels()) {↵ | 13 | if (isVerticalTickLabels()) {↵ | |
15 | anchor = TextAnchor.CENTER_RIGHT;↵ | 14 | ↵ | |
15 | if (edge == RectangleEdge.LEFT) {↵ | |||
16 | anchor = TextAnchor.BOTTOM_CENTER;↵ | |||
16 | rotationAnchor = TextAnchor.CENTER_RIGHT;↵ | 17 | rotationAnchor = TextAnchor.BOTTOM_CENTER;↵ | |
17 | if (edge == RectangleEdge.TOP) {↵ | 18 | angle = -Math.PI / 2.0;↵ | |
18 | ↵ | 19 | }↵ | |
19 | angle = Math.PI / 2.0;↵ | 20 | ↵ | |
20 | }↵ | |||
21 | else {↵ | 21 | else {↵ | |
22 | anchor = TextAnchor.BOTTOM_CENTER;↵ | |||
23 | rotationAnchor = TextAnchor.BOTTOM_CENTER;↵ | |||
22 | angle = -Math.PI / 2.0;↵ | 24 | angle = Math.PI / 2.0;↵ | |
23 | }↵ | 25 | }↵ | |
24 | }↵ | 26 | }↵ | |
25 | else {↵ | 27 | else {↵ | |
26 | if (edge == RectangleEdge.TOP) {↵ | 28 | if (edge == RectangleEdge.LEFT) {↵ | |
27 | anchor = TextAnchor.BOTTOM_CENTER;↵ | 29 | anchor = TextAnchor.CENTER_RIGHT;↵ | |
28 | rotationAnchor = TextAnchor.BOTTOM_CENTER;↵ | 30 | rotationAnchor = TextAnchor.CENTER_RIGHT;↵ | |
29 | }↵ | 31 | }↵ | |
30 | else {↵ | 32 | else {↵ | |
31 | anchor = TextAnchor.TOP_CENTER;↵ | 33 | anchor = TextAnchor.CENTER_LEFT;↵ | |
32 | rotationAnchor = TextAnchor.TOP_CENTER;↵ | 34 | rotationAnchor = TextAnchor.CENTER_LEFT;↵ | |
33 | }↵ | 35 | }↵ | |
34 | }↵ | 36 | }↵ | |
35 | Tick tick = new NumberTick(new Double(currentTickValue),↵ | 37 | Tick tick = new NumberTick(new Double(currentTickValue),↵ | |
36 | tickLabel, anchor, rotationAnchor, angle);↵ | 38 | tickLabel, anchor, rotationAnchor, angle);↵ | |
37 | result.add(tick);↵ | 39 |
| |
38 | } | |||
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.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 125 |
Number of mapped statements | 20 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 40.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11 | double currentTickValue = lowestTickValue + (i * size); | 12 | double currentTickValue = lowestTickValue + (i * size); | |||||||||||
12 | String tickLabel; | 13 | String tickLabel; | |||||||||||
13 | NumberFormat formatter = getNumberFormatOverride(); | 14 | NumberFormat formatter = getNumberFormatOverride(); | |||||||||||
14 | if (formatter != null) | 15 | if (formatter != null) | |||||||||||
15 | tickLabel = formatter.format(currentTickValue); | 16 | tickLabel = formatter.format(currentTickValue); | |||||||||||
else | else | |||||||||||||
16 | tickLabel = getTickUnit().valueToString(currentTickValue); | 17 | tickLabel = getTickUnit().valueToString(currentTickValue); | |||||||||||
17 | TextAnchor anchor = null; | 18 | TextAnchor anchor = null; | |||||||||||
18 | TextAnchor rotationAnchor = null; | 19 | TextAnchor rotationAnchor = null; | |||||||||||
19 | double angle = 0.0; | 20 | double angle = 0.0; | |||||||||||
20 | if (isVerticalTickLabels()) | 21 | if (isVerticalTickLabels()) | |||||||||||
21 | anchor = TextAnchor.CENTER_RIGHT; |
| | |||||||||||
22 | rotationAnchor = TextAnchor.CENTER_RIGHT; |
| | |||||||||||
23 | if (edge == RectangleEdge.TOP) |
| 22 | if (edge == RectangleEdge.LEFT) | ||||||||||
|
| 23 | anchor = TextAnchor.BOTTOM_CENTER; | |||||||||||
|
| 24 | rotationAnchor = TextAnchor.BOTTOM_CENTER; | |||||||||||
24 | angle = Math.PI / 2.0; |
| 25 | angle = -Math.PI / 2.0; | ||||||||||
else | else | |||||||||||||
|
| 26 | anchor = TextAnchor.BOTTOM_CENTER; | |||||||||||
|
| 27 | rotationAnchor = TextAnchor.BOTTOM_CENTER; | |||||||||||
25 | angle = -Math.PI / 2.0; |
| 28 | angle = Math.PI / 2.0; | ||||||||||
else | else | |||||||||||||
26 | if (edge == RectangleEdge.TOP) |
| 29 | if (edge == RectangleEdge.LEFT) | ||||||||||
27 | anchor = TextAnchor.BOTTOM_CENTER; |
| 30 | anchor = TextAnchor.CENTER_RIGHT; | ||||||||||
28 | rotationAnchor = TextAnchor.BOTTOM_CENTER; |
| 31 | rotationAnchor = TextAnchor.CENTER_RIGHT; | ||||||||||
else | else | |||||||||||||
29 | anchor = TextAnchor.TOP_CENTER; |
| 32 | anchor = TextAnchor.CENTER_LEFT; | ||||||||||
30 | rotationAnchor = TextAnchor.TOP_CENTER; |
| 33 | rotationAnchor = TextAnchor.CENTER_LEFT; | ||||||||||
31 | Tick tick = new NumberTick(new Double(currentTickValue), tickLabel, anchor, rotationAnchor, angle); | 34 | Tick tick = new NumberTick(new Double(currentTickValue), tickLabel, anchor, rotationAnchor, angle); | |||||||||||
32 | result.add(tick); | 35 | result.add(tick); |
Row | Violation |
---|---|
1 | Unmatched statement anchor=TextAnchor.CENTER_RIGHT; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement rotationAnchor=TextAnchor.CENTER_RIGHT; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement anchor=TextAnchor.BOTTOM_CENTER; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement rotationAnchor=TextAnchor.BOTTOM_CENTER; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement anchor=TextAnchor.BOTTOM_CENTER; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement rotationAnchor=TextAnchor.BOTTOM_CENTER; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Clone fragment #1 returns variables anchor, rotationAnchor , while Clone fragment #2 returns variables anchor, rotationAnchor |