File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/DateAxis.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/DateAxis.java | |||
Method name: List refreshTicksHorizontal(Graphics2D, Rectangle2D, RectangleEdge)
|
Method name: List refreshTicksVertical(Graphics2D, Rectangle2D, RectangleEdge)
|
|||
Number of AST nodes: 25 | Number of AST nodes: 24 | |||
1 | if (!isHiddenValue(tickDate.getTime())) {↵ | 1 | if (!isHiddenValue(tickDate.getTime())) {↵ | |
2 | // work out the value, label and position↵ | 2 | // work out the value, label and position↵ | |
3 | String tickLabel;↵ | 3 | String tickLabel;↵ | |
4 | DateFormat formatter = getDateFormatOverride();↵ | 4 | DateFormat formatter = getDateFormatOverride();↵ | |
5 | if (formatter != null) {↵ | 5 | if (formatter != null) {↵ | |
6 | tickLabel = formatter.format(tickDate);↵ | 6 | tickLabel = formatter.format(tickDate);↵ | |
7 | }↵ | 7 | }↵ | |
8 | else {↵ | 8 | else {↵ | |
9 | tickLabel = this.tickUnit.dateToString(tickDate);↵ | 9 | tickLabel = this.tickUnit.dateToString(tickDate);↵ | |
10 | }↵ | 10 | }↵ | |
11 | TextAnchor anchor = null;↵ | 11 | TextAnchor anchor = null;↵ | |
12 | TextAnchor rotationAnchor = null;↵ | 12 | TextAnchor rotationAnchor = null;↵ | |
13 | double angle = 0.0;↵ | 13 | double angle = 0.0;↵ | |
14 | if (isVerticalTickLabels()) {↵ | 14 | if (isVerticalTickLabels()) {↵ | |
15 | anchor = TextAnchor.CENTER_RIGHT;↵ | 15 | anchor = TextAnchor.BOTTOM_CENTER;↵ | |
16 | rotationAnchor = TextAnchor.CENTER_RIGHT;↵ | 16 | rotationAnchor = TextAnchor.BOTTOM_CENTER;↵ | |
17 | if (edge == RectangleEdge.TOP) {↵ | 17 | if (edge == RectangleEdge.LEFT) {↵ | |
18 | angle = Math.PI / 2.0;↵ | 18 | angle = -Math.PI / 2.0;↵ | |
19 | }↵ | 19 | }↵ | |
20 | else {↵ | 20 | else {↵ | |
21 | angle = -Math.PI / 2.0;↵ | 21 | angle = Math.PI / 2.0;↵ | |
22 | }↵ | 22 | }↵ | |
23 | }↵ | 23 | }↵ | |
24 | else {↵ | 24 | else {↵ | |
25 | if (edge == RectangleEdge.TOP) {↵ | 25 | if (edge == RectangleEdge.LEFT) {↵ | |
26 | anchor = TextAnchor.BOTTOM_CENTER;↵ | 26 | anchor = TextAnchor.CENTER_RIGHT;↵ | |
27 | rotationAnchor = TextAnchor.BOTTOM_CENTER;↵ | 27 | rotationAnchor = TextAnchor.CENTER_RIGHT;↵ | |
28 | }↵ | 28 | }↵ | |
29 | else {↵ | 29 | else {↵ | |
30 | anchor = TextAnchor.TOP_CENTER;↵ | 30 | anchor = TextAnchor.CENTER_LEFT;↵ | |
31 | rotationAnchor = TextAnchor.TOP_CENTER;↵ | 31 | rotationAnchor = TextAnchor.CENTER_LEFT;↵ | |
32 | }↵ | 32 | }↵ | |
33 | }↵ | 33 | }↵ | |
34 | Tick tick = new DateTick(tickDate, tickLabel, anchor,↵ | 34 | Tick tick = new DateTick(tickDate, tickLabel, anchor,↵ | |
35 | rotationAnchor, angle);↵ | 35 | rotationAnchor, angle);↵ | |
36 | result.add(tick);↵ | 36 | result.add(tick);↵ | |
37 | tickDate = unit.addToDate(tickDate, this.timeZone);↵ | 37 | tickDate = unit.addToDate(tickDate, this.timeZone);↵ | |
38 | }↵ | 38 | }↵ | |
39 | else {↵ | 39 | else {↵ | |
40 | tickDate = unit.rollDate(tickDate, this.timeZone);↵ | 40 | tickDate = unit.rollDate(tickDate, this.timeZone);↵ | |
41 | continue;↵ | |||
42 | } | 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 | 179 |
Number of mapped statements | 24 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 51.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10 | if (!isHiddenValue(tickDate.getTime())) | 10 | if (!isHiddenValue(tickDate.getTime())) | |||||||||||||
11 | String tickLabel; | 11 | String tickLabel; | |||||||||||||
12 | DateFormat formatter = getDateFormatOverride(); | 12 | DateFormat formatter = getDateFormatOverride(); | |||||||||||||
13 | if (formatter != null) | 13 | if (formatter != null) | |||||||||||||
14 | tickLabel = formatter.format(tickDate); | 14 | tickLabel = formatter.format(tickDate); | |||||||||||||
else | else | |||||||||||||||
15 | tickLabel = this.tickUnit.dateToString(tickDate); | 15 | tickLabel = this.tickUnit.dateToString(tickDate); | |||||||||||||
16 | TextAnchor anchor = null; |
| 17 | TextAnchor rotationAnchor = null; | ||||||||||||
17 | TextAnchor rotationAnchor = null; |
| 16 | TextAnchor anchor = null; | ||||||||||||
18 | double angle = 0.0; | 18 | double angle = 0.0; | |||||||||||||
19 | if (isVerticalTickLabels()) | 19 | if (isVerticalTickLabels()) | |||||||||||||
20 | anchor = TextAnchor.CENTER_RIGHT; |
| 20 | anchor = TextAnchor.BOTTOM_CENTER; | ||||||||||||
21 | rotationAnchor = TextAnchor.CENTER_RIGHT; |
| 21 | rotationAnchor = TextAnchor.BOTTOM_CENTER; | ||||||||||||
22 | if (edge == RectangleEdge.TOP) |
| 22 | if (edge == RectangleEdge.LEFT) | ||||||||||||
23 | angle = Math.PI / 2.0; |
| 23 | angle = -Math.PI / 2.0; | ||||||||||||
else | else | |||||||||||||||
24 | angle = -Math.PI / 2.0; |
| 24 | angle = Math.PI / 2.0; | ||||||||||||
else | else | |||||||||||||||
25 | if (edge == RectangleEdge.TOP) |
| 25 | if (edge == RectangleEdge.LEFT) | ||||||||||||
26 | anchor = TextAnchor.BOTTOM_CENTER; |
| 26 | anchor = TextAnchor.CENTER_RIGHT; | ||||||||||||
27 | rotationAnchor = TextAnchor.BOTTOM_CENTER; |
| 27 | rotationAnchor = TextAnchor.CENTER_RIGHT; | ||||||||||||
else | else | |||||||||||||||
28 | anchor = TextAnchor.TOP_CENTER; |
| 28 | anchor = TextAnchor.CENTER_LEFT; | ||||||||||||
29 | rotationAnchor = TextAnchor.TOP_CENTER; |
| 29 | rotationAnchor = TextAnchor.CENTER_LEFT; | ||||||||||||
30 | Tick tick = new DateTick(tickDate, tickLabel, anchor, rotationAnchor, angle); | 30 | Tick tick = new DateTick(tickDate, tickLabel, anchor, rotationAnchor, angle); | |||||||||||||
31 | result.add(tick); | 31 | result.add(tick); | |||||||||||||
32 | tickDate = unit.addToDate(tickDate, this.timeZone); | 32 | tickDate = unit.addToDate(tickDate, this.timeZone); | |||||||||||||
else | else | |||||||||||||||
33 | tickDate = unit.rollDate(tickDate, this.timeZone); | 33 | tickDate = unit.rollDate(tickDate, this.timeZone); | |||||||||||||
34 | continue; |
| |
Row | Violation |
---|---|
1 | Expression anchor cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression rotationAnchor cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression anchor cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Unmatched continue; |