File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java | |||
Method name: void drawHorizontalLine(Graphics2D, Rectangle2D, double, Stroke, Paint)
|
Method name: void drawVerticalLine(Graphics2D, Rectangle2D, double, Stroke, Paint)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | ValueAxis axis = getRangeAxis();↵ | 1 | ValueAxis axis = getDomainAxis();↵ | |
2 | if (getOrientation() == PlotOrientation.HORIZONTAL) {↵ | 2 | if (getOrientation() == PlotOrientation.HORIZONTAL) {↵ | |
3 | axis = getDomainAxis();↵ | 3 | axis = getRangeAxis();↵ | |
4 | }↵ | 4 | }↵ | |
5 | if (axis.getRange().contains(value)) {↵ | 5 | if (axis.getRange().contains(value)) {↵ | |
6 | double yy = axis.valueToJava2D(value, dataArea,↵ | 6 | double xx = axis.valueToJava2D(value, dataArea,↵ | |
7 | RectangleEdge.LEFT);↵ | 7 | RectangleEdge.BOTTOM);↵ | |
8 | Line2D line = new Line2D.Double(dataArea.getMinX(), yy,↵ | 8 | Line2D line = new Line2D.Double(xx, dataArea.getMinY(), xx,↵ | |
9 | dataArea.getMaxX(), yy);↵ | 9 | dataArea.getMaxY());↵ | |
10 | g2.setStroke(stroke);↵ | 10 | g2.setStroke(stroke);↵ | |
11 | g2.setPaint(paint);↵ | 11 | g2.setPaint(paint);↵ | |
12 | g2.draw(line);↵ | 12 | g2.draw(line);↵ | |
13 | } | 13 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 43 |
Number of mapped statements | 9 |
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) | 9.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | ValueAxis axis = getRangeAxis(); |
| 1 | ValueAxis axis = getDomainAxis(); | |||||||||||||||||||||||
2 | if (getOrientation() == PlotOrientation.HORIZONTAL) | 2 | if (getOrientation() == PlotOrientation.HORIZONTAL) | ||||||||||||||||||||||||
3 | axis = getDomainAxis(); |
| 3 | axis = getRangeAxis(); | |||||||||||||||||||||||
4 | if (axis.getRange().contains(value)) | 4 | if (axis.getRange().contains(value)) | ||||||||||||||||||||||||
5 | double yy = axis.valueToJava2D(value, dataArea, RectangleEdge.LEFT); |
| 5 | double xx = axis.valueToJava2D(value, dataArea, RectangleEdge.BOTTOM); | |||||||||||||||||||||||
6 | Line2D line = new Line2D.Double(dataArea.getMinX(), yy, dataArea.getMaxX(), yy); |
| 6 | Line2D line = new Line2D.Double(xx, dataArea.getMinY(), xx, dataArea.getMaxY()); | |||||||||||||||||||||||
7 | g2.setStroke(stroke); | 7 | g2.setStroke(stroke); | ||||||||||||||||||||||||
8 | g2.setPaint(paint); | 8 | g2.setPaint(paint); | ||||||||||||||||||||||||
9 | g2.draw(line); | 9 | g2.draw(line); |
Row | Violation |
---|---|
1 | Expression xx cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression yy cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression xx cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression yy cannot be parameterized, because it has dependencies to/from statements that will be extracted |