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 drawDomainLine(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.getDomainAxisEdge());↵ | |
11 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | |||
10 | line = new Line2D.Double(xx, dataArea.getMinY(), xx,↵ | 12 | line = new Line2D.Double(dataArea.getMinX(), ↵ | |
11 | dataArea.getMaxY());↵ | 13 | v, dataArea.getMaxX(),↵ | |
12 | }↵ | 14 | ↵ | |
13 | else {↵ | |||
14 | double yy = axis.valueToJava2D(value, dataArea,↵ | |||
15 | ↵ | 15 | v);↵ | |
16 | ↵ | 16 | }↵ | |
17 | RectangleEdge.LEFT);↵ | 17 | else if (orientation == PlotOrientation.VERTICAL) {↵ | |
18 | line = new Line2D.Double(dataArea.getMinX(), yy,↵ | 18 | line = new Line2D.Double(v, dataArea.getMinY(), v,↵ | |
19 | dataArea.getMaxX(), yy);↵ | 19 | dataArea.getMaxY());↵ | |
20 | }↵ | 20 | }↵ | |
21 | g2.setStroke(stroke);↵ | 21 | g2.setPaint(paint);↵ | |
22 | g2.setPaint(paint);↵ | 22 | g2.setStroke(stroke);↵ | |
23 | g2.draw(line); | 23 |
| |
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.6 |
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.getDomainAxisEdge()); | ||||||||||||||||||||||||
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(dataArea.getMinX(), v, dataArea.getMaxX(), v); | |||||||||||||||||||||||
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.getDomainAxisEdge()); 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 | Expression xx cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression v cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression xx cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression v cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | 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 |
12 | 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 |
13 | 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 |