File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CyclicNumberAxis.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ValueAxis.java | |||
Method name: AxisState drawTickMarksAndLabels(Graphics2D, double, Rectangle2D, Rectangle2D, RectangleEdge)
|
Method name: AxisState drawTickMarksAndLabels(Graphics2D, double, Rectangle2D, Rectangle2D, RectangleEdge)
|
|||
Number of AST nodes: 14 | Number of AST nodes: 13 | |||
1 | if (isTickMarksVisible()) {↵ | |||
2 | float xx = (float) valueToJava2D(↵ | |||
3 | getRange().getUpperBound(), dataArea, edge↵ | 1 | float xx = (float) valueToJava2D(tick.getValue(), dataArea,↵ | |
4 | );↵ | 2 | ↵ | |
3 | edge);↵ | |||
5 | Line2D mark = null;↵ | 4 | Line2D mark = null;↵ | |
6 | g2.setStroke(getTickMarkStroke());↵ | 5 | g2.setStroke(getTickMarkStroke());↵ | |
7 | g2.setPaint(getTickMarkPaint());↵ | 6 | g2.setPaint(getTickMarkPaint());↵ | |
8 | if (edge == RectangleEdge.LEFT) {↵ | 7 | if (edge == RectangleEdge.LEFT) {↵ | |
9 | mark = new Line2D.Double(cursor - ol, xx, cursor + il, xx);↵ | 8 | mark = new Line2D.Double(cursor - ol, xx, cursor + il, xx);↵ | |
10 | }↵ | 9 | ↵ | |
10 | }↵ | |||
11 | else if (edge == RectangleEdge.RIGHT) {↵ | 11 | else if (edge == RectangleEdge.RIGHT) {↵ | |
12 | mark = new Line2D.Double(cursor + ol, xx, cursor - il, xx);↵ | 12 | mark = new Line2D.Double(cursor + ol, xx, cursor - il, xx);↵ | |
13 | }↵ | 13 | ↵ | |
14 | }↵ | |||
14 | else if (edge == RectangleEdge.TOP) {↵ | 15 | else if (edge == RectangleEdge.TOP) {↵ | |
15 | mark = new Line2D.Double(xx, cursor - ol, xx, cursor + il);↵ | 16 | mark = new Line2D.Double(xx, cursor - ol, xx, cursor + il);↵ | |
16 | }↵ | 17 | ↵ | |
18 | }↵ | |||
17 | else if (edge == RectangleEdge.BOTTOM) {↵ | 19 | else if (edge == RectangleEdge.BOTTOM) {↵ | |
18 | mark = new Line2D.Double(xx, cursor + ol, xx, cursor - il);↵ | 20 | mark = new Line2D.Double(xx, cursor + ol, xx, cursor - il);↵ | |
19 | }↵ | 21 | ↵ | |
22 | }↵ | |||
20 | g2.draw(mark);↵ | 23 | g2.draw(mark); | |
21 | } | |||
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) | 1.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 72 |
Number of mapped statements | 12 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 26.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
12 | float xx = (float)valueToJava2D(getRange().getUpperBound(), dataArea, edge); | | |||||
|
| 17 | float xx = (float)valueToJava2D(tick.getValue(), dataArea, edge); | ||||
13 | Line2D mark = null; | 18 | Line2D mark = null; | ||||
14 | g2.setStroke(getTickMarkStroke()); | 19 | g2.setStroke(getTickMarkStroke()); | ||||
15 | g2.setPaint(getTickMarkPaint()); | 20 | g2.setPaint(getTickMarkPaint()); | ||||
16 | if (edge == RectangleEdge.LEFT) | 21 | if (edge == RectangleEdge.LEFT) | ||||
17 | mark = new Line2D.Double(cursor - ol, xx, cursor + il, xx); | 22 | mark = new Line2D.Double(cursor - ol, xx, cursor + il, xx); | ||||
18 | else if (edge == RectangleEdge.RIGHT) | 23 | else if (edge == RectangleEdge.RIGHT) | ||||
19 | mark = new Line2D.Double(cursor + ol, xx, cursor - il, xx); | 24 | mark = new Line2D.Double(cursor + ol, xx, cursor - il, xx); | ||||
20 | else if (edge == RectangleEdge.TOP) | 25 | else if (edge == RectangleEdge.TOP) | ||||
21 | mark = new Line2D.Double(xx, cursor - ol, xx, cursor + il); | 26 | mark = new Line2D.Double(xx, cursor - ol, xx, cursor + il); | ||||
22 | else if (edge == RectangleEdge.BOTTOM) | 27 | else if (edge == RectangleEdge.BOTTOM) | ||||
23 | mark = new Line2D.Double(xx, cursor + ol, xx, cursor - il); | 28 | mark = new Line2D.Double(xx, cursor + ol, xx, cursor - il); | ||||
24 | g2.draw(mark); | 29 | g2.draw(mark); |
Row | Violation |
---|---|
1 | Unmatched statement float xx=(float)valueToJava2D(tick.getValue(),dataArea,edge); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |