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