File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/BoxAndWhiskerRenderer.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/BoxAndWhiskerRenderer.java | |||
Method name: void drawHorizontalItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset, int, int)
|
Method name: void drawVerticalItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset, int, int)
|
|||
Number of AST nodes: 15 | Number of AST nodes: 15 | |||
1 | double xxQ1 = rangeAxis.valueToJava2D(xQ1.doubleValue(), dataArea,↵ | 1 | double yyQ1 = rangeAxis.valueToJava2D(yQ1.doubleValue(), dataArea,↵ | |
2 | location);↵ | 2 | location);↵ | |
3 | double xxQ3 = rangeAxis.valueToJava2D(xQ3.doubleValue(), dataArea,↵ | 3 | double yyQ3 = rangeAxis.valueToJava2D(yQ3.doubleValue(), dataArea,↵ | |
4 | location);↵ | 4 | location);↵ | |
5 | double xxMax = rangeAxis.valueToJava2D(xMax.doubleValue(), dataArea,↵ | 5 | double yyMax = rangeAxis.valueToJava2D(yMax.doubleValue(),↵ | |
6 | location);↵ | 6 | dataArea, location);↵ | |
7 | double xxMin = rangeAxis.valueToJava2D(xMin.doubleValue(), dataArea,↵ | 7 | double yyMin = rangeAxis.valueToJava2D(yMin.doubleValue(),↵ | |
8 | location);↵ | 8 | dataArea, location);↵ | |
9 | double yymid = yy + state.getBarWidth() / 2.0;↵ | 9 | double xxmid = xx + state.getBarWidth() / 2.0;↵ | |
10 | // draw the upper shadow...↵ | 10 | // draw the upper shadow...↵ | |
11 | g2.draw(new Line2D.Double(xxMax, yymid, xxQ3, yymid));↵ | 11 | g2.draw(new Line2D.Double(xxmid, yyMax, xxmid, yyQ3));↵ | |
12 | g2.draw(new Line2D.Double(xxMax, yy, xxMax,↵ | 12 | g2.draw(new Line2D.Double(xx, yyMax, xx + state.getBarWidth(),↵ | |
13 | yy + state.getBarWidth()));↵ | 13 | yyMax));↵ | |
14 | // draw the lower shadow...↵ | 14 | // draw the lower shadow...↵ | |
15 | g2.draw(new Line2D.Double(xxMin, yymid, xxQ1, yymid));↵ | 15 | g2.draw(new Line2D.Double(xxmid, yyMin, xxmid, yyQ1));↵ | |
16 | g2.draw(new Line2D.Double(xxMin, yy, xxMin,↵ | 16 | g2.draw(new Line2D.Double(xx, yyMin, xx + state.getBarWidth(),↵ | |
17 | yy + state.getBarWidth()));↵ | 17 | yyMin));↵ | |
18 | // draw the box...↵ | 18 | // draw the body...↵ | |
19 | box = new Rectangle2D.Double(Math.min(xxQ1, xxQ3), yy,↵ | 19 | box = new Rectangle2D.Double(xx, Math.min(yyQ1, yyQ3),↵ | |
20 | Math.abs(xxQ1 - xxQ3), state.getBarWidth());↵ | 20 | state.getBarWidth(), Math.abs(yyQ1 - yyQ3));↵ | |
21 | if (this.fillBox) {↵ | 21 | if (this.fillBox) {↵ | |
22 | g2.fill(box);↵ | 22 | g2.fill(box);↵ | |
23 | }↵ | 23 | }↵ | |
24 | g2.setStroke(getItemOutlineStroke(row, column));↵ | 24 | g2.setStroke(getItemOutlineStroke(row, column));↵ | |
25 | g2.setPaint(getItemOutlinePaint(row, column));↵ | 25 | g2.setPaint(getItemOutlinePaint(row, column));↵ | |
26 | g2.draw(box); | 26 |
| |
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 174 |
Number of mapped statements | 14 |
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) | 130.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
25 | double xxQ1 = rangeAxis.valueToJava2D(xQ1.doubleValue(), dataArea, location); |
| 29 | double yyQ1 = rangeAxis.valueToJava2D(yQ1.doubleValue(), dataArea, location); | |||||||||||||||||||||||
26 | double xxQ3 = rangeAxis.valueToJava2D(xQ3.doubleValue(), dataArea, location); |
| 30 | double yyQ3 = rangeAxis.valueToJava2D(yQ3.doubleValue(), dataArea, location); | |||||||||||||||||||||||
27 | double xxMax = rangeAxis.valueToJava2D(xMax.doubleValue(), dataArea, location); |
| 33 | double xxmid = xx + state.getBarWidth() / 2.0; | |||||||||||||||||||||||
28 | double xxMin = rangeAxis.valueToJava2D(xMin.doubleValue(), dataArea, location); |
| 32 | double yyMin = rangeAxis.valueToJava2D(yMin.doubleValue(), dataArea, location); | |||||||||||||||||||||||
29 | double yymid = yy + state.getBarWidth() / 2.0; |
| 31 | double yyMax = rangeAxis.valueToJava2D(yMax.doubleValue(), dataArea, location); | |||||||||||||||||||||||
30 | g2.draw(new Line2D.Double(xxMax, yymid, xxQ3, yymid)); |
| 34 | g2.draw(new Line2D.Double(xxmid, yyMax, xxmid, yyQ3)); | |||||||||||||||||||||||
31 | g2.draw(new Line2D.Double(xxMax, yy, xxMax, yy + state.getBarWidth())); |
| 36 | g2.draw(new Line2D.Double(xxmid, yyMin, xxmid, yyQ1)); | |||||||||||||||||||||||
32 | g2.draw(new Line2D.Double(xxMin, yymid, xxQ1, yymid)); |
| 35 | g2.draw(new Line2D.Double(xx, yyMax, xx + state.getBarWidth(), yyMax)); | |||||||||||||||||||||||
33 | g2.draw(new Line2D.Double(xxMin, yy, xxMin, yy + state.getBarWidth())); |
| 37 | g2.draw(new Line2D.Double(xx, yyMin, xx + state.getBarWidth(), yyMin)); | |||||||||||||||||||||||
34 | box = new Rectangle2D.Double(Math.min(xxQ1, xxQ3), yy, Math.abs(xxQ1 - xxQ3), state.getBarWidth()); |
| | ||||||||||||||||||||||||
|
| 38 | box = new Rectangle2D.Double(xx, Math.min(yyQ1, yyQ3), state.getBarWidth(), Math.abs(yyQ1 - yyQ3)); | ||||||||||||||||||||||||
35 | if (this.fillBox) | 39 | if (this.fillBox) | ||||||||||||||||||||||||
36 | g2.fill(box); | 40 | g2.fill(box); | ||||||||||||||||||||||||
37 | g2.setStroke(getItemOutlineStroke(row, column)); | 41 | g2.setStroke(getItemOutlineStroke(row, column)); | ||||||||||||||||||||||||
38 | g2.setPaint(getItemOutlinePaint(row, column)); | 42 | g2.setPaint(getItemOutlinePaint(row, column)); | ||||||||||||||||||||||||
39 | g2.draw(box); | 43 | g2.draw(box); |
Row | Violation |
---|---|
1 | Expression rangeAxis.valueToJava2D(xMax.doubleValue(),dataArea,location) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression rangeAxis.valueToJava2D(yMax.doubleValue(),dataArea,location) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression yyMin cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression yyQ1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression xxMin cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression xxQ1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression xxMin cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression yyMin cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression xxMin cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression yyMin cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Unmatched statement box=new Rectangle2D.Double(Math.min(xxQ1,xxQ3),yy,Math.abs(xxQ1 - xxQ3),state.getBarWidth()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
12 | Unmatched statement box=new Rectangle2D.Double(xx,Math.min(yyQ1,yyQ3),state.getBarWidth(),Math.abs(yyQ1 - yyQ3)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
13 | Clone fragment #1 returns variables xxQ1, xxQ3 , while Clone fragment #2 returns variables yyQ1, yyQ3 |