File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java | |||
Method name: void drawRangeCrosshair(Graphics2D, Rectangle2D, PlotOrientation, double, ValueAxis, Stroke, Paint)
|
Method name: void drawRangeLine(Graphics2D, XYPlot, ValueAxis, Rectangle2D, double, Paint, Stroke)
|
|||
Number of AST nodes: 11 | Number of AST nodes: 13 | |||
1 | if (!axis.getRange()↵ | 1 | Range range = axis.getRange();↵ | |
2 | .contains(value)) {↵ | 2 | if (!range.contains(value)) {↵ | |
3 | return;↵ | 3 | return;↵ | |
4 | }↵ | 4 | }↵ | |
5 | Line2D line = null;↵ | 5 | ↵ | |
6 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | 6 | PlotOrientation orientation = plot.getOrientation↵ | |
7 | ↵ | 7 | ();↵ | |
8 | Line2D line = null;↵ | |||
8 | double xx = axis.valueToJava2D(value, dataArea,↵ | 9 | double v = axis.valueToJava2D(value, dataArea,↵ | |
9 | RectangleEdge.BOTTOM);↵ | 10 | plot.getRangeAxisEdge());↵ | |
11 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | |||
10 | line = new Line2D.Double(xx, dataArea.getMinY(), xx,↵ | 12 | line = new Line2D.Double(v, dataArea.getMinY(), v,↵ | |
11 | dataArea.getMaxY());↵ | 13 | dataArea.getMaxY());↵ | |
12 | }↵ | 14 | }↵ | |
13 | else {↵ | 15 | else ↵ | |
14 | double yy = axis.valueToJava2D(value, dataArea,↵ | |||
15 | RectangleEdge.LEFT);↵ | 16 | if (orientation == PlotOrientation.VERTICAL) {↵ | |
16 | line = new Line2D.Double(dataArea.getMinX(), yy,↵ | 17 | line = new Line2D.Double(dataArea.getMinX(), v,↵ | |
17 | dataArea.getMaxX(), yy);↵ | 18 | dataArea.getMaxX(), v);↵ | |
18 | }↵ | 19 | }↵ | |
19 | g2.setStroke(stroke);↵ | 20 | g2.setPaint(paint);↵ | |
20 | g2.setPaint(paint);↵ | 21 | g2.setStroke(stroke);↵ | |
21 | g2.draw(line); | 22 |
| |
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.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 22 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 22.3 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Range range = axis.getRange(); | |||||||||||||||
1 | if (!axis.getRange().contains(value)) |
| 2 | if (!range.contains(value)) | |||||||||||||
2 | return; |
| 3 | return; | |||||||||||||
| 4 | PlotOrientation orientation = plot.getOrientation(); | |||||||||||||||
3 | Line2D line = null; | 5 | Line2D line = null; | ||||||||||||||
|
| 6 | double v = axis.valueToJava2D(value, dataArea, plot.getRangeAxisEdge()); | ||||||||||||||
4 | if (orientation == PlotOrientation.HORIZONTAL) | 7 | if (orientation == PlotOrientation.HORIZONTAL) | ||||||||||||||
5 | double xx = axis.valueToJava2D(value, dataArea, RectangleEdge.BOTTOM); |
| | ||||||||||||||
6 | line = new Line2D.Double(xx, dataArea.getMinY(), xx, dataArea.getMaxY()); |
| 8 | line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY()); | |||||||||||||
else | | ||||||||||||||||
7 | double yy = axis.valueToJava2D(value, dataArea, RectangleEdge.LEFT); |
| | ||||||||||||||
8 | line = new Line2D.Double(dataArea.getMinX(), yy, dataArea.getMaxX(), yy); |
| |
Row | Violation |
---|---|
1 | Expression range cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Conditional return; |
3 | Conditional return; |
4 | Unmatched statement double v=axis.valueToJava2D(value,dataArea,plot.getRangeAxisEdge()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Unmatched statement double xx=axis.valueToJava2D(value,dataArea,RectangleEdge.BOTTOM); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Unmatched statement double xx=axis.valueToJava2D(value,dataArea,RectangleEdge.BOTTOM); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
7 | Unmatched statement double yy=axis.valueToJava2D(value,dataArea,RectangleEdge.LEFT); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
8 | Unmatched statement double yy=axis.valueToJava2D(value,dataArea,RectangleEdge.LEFT); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
9 | Unmatched statement line=new Line2D.Double(dataArea.getMinX(),yy,dataArea.getMaxX(),yy); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |