File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java | |||
Method name: void fillDomainGridBand(Graphics2D, XYPlot, ValueAxis, Rectangle2D, double, double)
|
Method name: void fillRangeGridBand(Graphics2D, XYPlot, ValueAxis, Rectangle2D, double, double)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | double x1 = axis.valueToJava2D(start, dataArea,↵ | 1 | double y1 = axis.valueToJava2D(start, dataArea,↵ | |
2 | plot.getDomainAxisEdge());↵ | 2 | plot.getRangeAxisEdge());↵ | |
3 | double x2 = axis.valueToJava2D(end, dataArea,↵ | 3 | double y2 = axis.valueToJava2D(end, dataArea,↵ | |
4 | plot.getDomainAxisEdge());↵ | 4 | plot.getRangeAxisEdge());↵ | |
5 | Rectangle2D band;↵ | 5 | Rectangle2D band;↵ | |
6 | if (plot.getOrientation() == PlotOrientation.VERTICAL) {↵ | 6 | if (plot.getOrientation() == PlotOrientation.VERTICAL) {↵ | |
7 | band = new Rectangle2D.Double(Math.min(x1, x2), dataArea.getMinY(),↵ | 7 | band = new Rectangle2D.Double(dataArea.getMinX(),↵ | |
8 | Math.abs(x2 - x1), dataArea.getWidth(↵ | 8 | Math.min(y1, y2),↵ | |
9 | ));↵ | 9 | dataArea.getWidth(), Math.abs(y2 - y1));↵ | |
10 | }↵ | 10 | }↵ | |
11 | else {↵ | 11 | else {↵ | |
12 | band = new Rectangle2D.Double(dataArea.getMinX(), Math.min(x1, x2),↵ | 12 | band = new Rectangle2D.Double(Math.min(y1, y2), dataArea.getMinY(),↵ | |
13 | dataArea.getWidth(), Math.abs(x2 - x1↵ | |||
14 | ));↵ | 13 | Math.abs(y2 - y1), dataArea.getHeight());↵ | |
15 | }↵ | 14 | }↵ | |
16 | Paint paint = plot.getDomainTickBandPaint();↵ | 15 | Paint paint = plot.getRangeTickBandPaint();↵ | |
17 | if (paint != null) {↵ | 16 | if (paint != null) {↵ | |
18 | g2.setPaint(paint);↵ | 17 | g2.setPaint(paint);↵ | |
19 | g2.fill(band);↵ | 18 | g2.fill(band);↵ | |
20 | } | 19 |
| |
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 36 |
Number of mapped statements | 10 |
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) | 81.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | double x1 = axis.valueToJava2D(start, dataArea, plot.getDomainAxisEdge()); |
| 1 | double y1 = axis.valueToJava2D(start, dataArea, plot.getRangeAxisEdge()); | |||||||||||||||||||||||
2 | double x2 = axis.valueToJava2D(end, dataArea, plot.getDomainAxisEdge()); |
| 2 | double y2 = axis.valueToJava2D(end, dataArea, plot.getRangeAxisEdge()); | |||||||||||||||||||||||
3 | Rectangle2D band; | 3 | Rectangle2D band; | ||||||||||||||||||||||||
4 | if (plot.getOrientation() == PlotOrientation.VERTICAL) | 4 | if (plot.getOrientation() == PlotOrientation.VERTICAL) | ||||||||||||||||||||||||
5 | band = new Rectangle2D.Double(Math.min(x1, x2), dataArea.getMinY(), Math.abs(x2 - x1), dataArea.getWidth()); |
| 5 | band = new Rectangle2D.Double(dataArea.getMinX(), Math.min(y1, y2), dataArea.getWidth(), Math.abs(y2 - y1)); | |||||||||||||||||||||||
else | else | ||||||||||||||||||||||||||
6 | band = new Rectangle2D.Double(dataArea.getMinX(), Math.min(x1, x2), dataArea.getWidth(), Math.abs(x2 - x1)); |
| 6 | band = new Rectangle2D.Double(Math.min(y1, y2), dataArea.getMinY(), Math.abs(y2 - y1), dataArea.getHeight()); | |||||||||||||||||||||||
7 | Paint paint = plot.getDomainTickBandPaint(); |
| 7 | Paint paint = plot.getRangeTickBandPaint(); | |||||||||||||||||||||||
8 | if (paint != null) | 8 | if (paint != null) | ||||||||||||||||||||||||
9 | g2.setPaint(paint); | 9 | g2.setPaint(paint); | ||||||||||||||||||||||||
10 | g2.fill(band); | 10 | g2.fill(band); |
Row | Violation |
---|---|
1 | Expression Math.min(x1,x2) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression Math.min(y1,y2) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression Math.abs(x2 - x1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression Math.abs(y2 - y1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression Math.min(y1,y2) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression Math.min(x1,x2) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression Math.abs(y2 - y1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression Math.abs(x2 - x1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |