File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/LineAndShapeRenderer.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StatisticalLineAndShapeRenderer.java | |||
Method name: void drawItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset, int, int, int)
|
Method name: void drawItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset, int, int, int)
|
|||
Number of AST nodes: 15 | Number of AST nodes: 15 | |||
1 | if (previousValue != null) {↵ | 1 | if (previousValue != null) {↵ | |
2 | // previous data point...↵ | 2 | // previous data point...↵ | |
3 | double previous = previousValue.doubleValue();↵ | 3 | double previous = previousValue.doubleValue();↵ | |
4 | double x0;↵ | 4 | double x0;↵ | |
5 | if (this.useSeriesOffset) {↵ | 5 | if (getUseSeriesOffset()) {↵ | |
6 | x0 = domainAxis.getCategorySeriesMiddle(↵ | 6 | x0 = domainAxis.getCategorySeriesMiddle(↵ | |
7 | dataset.getColumnKey(column - 1),↵ | 7 | dataset.getColumnKey(column - 1),↵ | |
8 | dataset.getRowKey(row), dataset,↵ | 8 | dataset.getRowKey(row), dataset,↵ | |
9 | this.itemMargin, dataArea,↵ | 9 | getItemMargin(), dataArea,↵ | |
10 | plot.getDomainAxisEdge());↵ | 10 | plot.getDomainAxisEdge());↵ | |
11 | }↵ | 11 | }↵ | |
12 | else {↵ | 12 | else {↵ | |
13 | x0 = domainAxis.getCategoryMiddle(column - 1,↵ | 13 | x0 = domainAxis.getCategoryMiddle(column - 1,↵ | |
14 | getColumnCount(), dataArea,↵ | 14 | getColumnCount(), dataArea,↵ | |
15 | plot.getDomainAxisEdge());↵ | 15 | plot.getDomainAxisEdge());↵ | |
16 | }↵ | 16 | }↵ | |
17 | double y0 = rangeAxis.valueToJava2D(previous, dataArea,↵ | 17 | double y0 = rangeAxis.valueToJava2D(previous, dataArea,↵ | |
18 | plot.getRangeAxisEdge());↵ | 18 | plot.getRangeAxisEdge());↵ | |
19 | Line2D line = null;↵ | 19 | Line2D line = null;↵ | |
20 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | 20 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | |
21 | line = new Line2D.Double(y0, x0, y1, x1);↵ | 21 | line = new Line2D.Double(y0, x0, y1, x1);↵ | |
22 | }↵ | 22 | }↵ | |
23 | else if (orientation == PlotOrientation.VERTICAL) {↵ | 23 | else if (orientation == PlotOrientation.VERTICAL) {↵ | |
24 | line = new Line2D.Double(x0, y0, x1, y1);↵ | 24 | line = new Line2D.Double(x0, y0, x1, y1);↵ | |
25 | }↵ | 25 | }↵ | |
26 | g2.setPaint(getItemPaint(row, column));↵ | 26 | g2.setPaint(getItemPaint(row, column));↵ | |
27 | g2.setStroke(getItemStroke(row, column));↵ | 27 | g2.setStroke(getItemStroke(row, column));↵ | |
28 | g2.draw(line);↵ | 28 | g2.draw(line);↵ | |
29 | } | 29 |
| |
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.9 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 101 |
Number of mapped statements | 15 |
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) | 96.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18 | if (previousValue != null) | 34 | if (previousValue != null) | |||||||||||||||
19 | double previous = previousValue.doubleValue(); | 35 | double previous = previousValue.doubleValue(); | |||||||||||||||
20 | double x0; | 36 | double x0; | |||||||||||||||
21 | if (this.useSeriesOffset) |
| 37 | if (getUseSeriesOffset()) | ||||||||||||||
22 | x0 = domainAxis.getCategorySeriesMiddle(dataset.getColumnKey(column - 1), dataset.getRowKey(row), dataset, this.itemMargin, dataArea, plot.getDomainAxisEdge()); |
| 38 | x0 = domainAxis.getCategorySeriesMiddle(dataset.getColumnKey(column - 1), dataset.getRowKey(row), dataset, getItemMargin(), dataArea, plot.getDomainAxisEdge()); | ||||||||||||||
else | else | |||||||||||||||||
23 | x0 = domainAxis.getCategoryMiddle(column - 1, getColumnCount(), dataArea, plot.getDomainAxisEdge()); | 39 | x0 = domainAxis.getCategoryMiddle(column - 1, getColumnCount(), dataArea, plot.getDomainAxisEdge()); | |||||||||||||||
24 | double y0 = rangeAxis.valueToJava2D(previous, dataArea, plot.getRangeAxisEdge()); | 40 | double y0 = rangeAxis.valueToJava2D(previous, dataArea, plot.getRangeAxisEdge()); | |||||||||||||||
25 | Line2D line = null; | 41 | Line2D line = null; | |||||||||||||||
26 | if (orientation == PlotOrientation.HORIZONTAL) | 42 | if (orientation == PlotOrientation.HORIZONTAL) | |||||||||||||||
27 | line = new Line2D.Double(y0, x0, y1, x1); | 43 | line = new Line2D.Double(y0, x0, y1, x1); | |||||||||||||||
28 | else if (orientation == PlotOrientation.VERTICAL) | 44 | else if (orientation == PlotOrientation.VERTICAL) | |||||||||||||||
29 | line = new Line2D.Double(x0, y0, x1, y1); | 45 | line = new Line2D.Double(x0, y0, x1, y1); | |||||||||||||||
30 | g2.setPaint(getItemPaint(row, column)); | 46 | g2.setPaint(getItemPaint(row, column)); | |||||||||||||||
31 | g2.setStroke(getItemStroke(row, column)); | 47 | g2.setStroke(getItemStroke(row, column)); | |||||||||||||||
32 | g2.draw(line); | 48 | g2.draw(line); |
Row | Violation |
---|---|
1 | Expression getItemMargin() is a method call throwing exception(s) that should be caught by a try block that will be extracted |