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: 17 | Number of AST nodes: 17 | |||
1 | if (column != 0) {↵ | 1 | if (column != 0) {↵ | |
2 | Number previousValue = dataset.getValue(row, column - 1);↵ | 2 | Number previousValue = statData.getValue(row, column - 1);↵ | |
3 | if (previousValue != null) {↵ | 3 | if (previousValue != null) {↵ | |
4 | // previous data point...↵ | 4 | // previous data point...↵ | |
5 | double previous = previousValue.doubleValue();↵ | 5 | double previous = previousValue.doubleValue();↵ | |
6 | double x0;↵ | 6 | double x0;↵ | |
7 | if (this.useSeriesOffset) {↵ | 7 | if (getUseSeriesOffset()) {↵ | |
8 | x0 = domainAxis.getCategorySeriesMiddle(↵ | 8 | x0 = domainAxis.getCategorySeriesMiddle(↵ | |
9 | dataset.getColumnKey(column - 1),↵ | 9 | dataset.getColumnKey(column - 1),↵ | |
10 | dataset.getRowKey(row), dataset,↵ | 10 | dataset.getRowKey(row), dataset,↵ | |
11 | this.itemMargin, dataArea,↵ | 11 | getItemMargin(), dataArea,↵ | |
12 | plot.getDomainAxisEdge());↵ | 12 | plot.getDomainAxisEdge());↵ | |
13 | }↵ | 13 | }↵ | |
14 | else {↵ | 14 | else {↵ | |
15 | x0 = domainAxis.getCategoryMiddle(column - 1,↵ | 15 | x0 = domainAxis.getCategoryMiddle(column - 1,↵ | |
16 | getColumnCount(), dataArea,↵ | 16 | getColumnCount(), dataArea,↵ | |
17 | plot.getDomainAxisEdge());↵ | 17 | plot.getDomainAxisEdge());↵ | |
18 | }↵ | 18 | }↵ | |
19 | double y0 = rangeAxis.valueToJava2D(previous, dataArea,↵ | 19 | double y0 = rangeAxis.valueToJava2D(previous, dataArea,↵ | |
20 | plot.getRangeAxisEdge());↵ | 20 | plot.getRangeAxisEdge());↵ | |
21 | Line2D line = null;↵ | 21 | Line2D line = null;↵ | |
22 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | 22 | if (orientation == PlotOrientation.HORIZONTAL) {↵ | |
23 | line = new Line2D.Double(y0, x0, y1, x1);↵ | 23 | line = new Line2D.Double(y0, x0, y1, x1);↵ | |
24 | }↵ | 24 | }↵ | |
25 | else if (orientation == PlotOrientation.VERTICAL) {↵ | 25 | else if (orientation == PlotOrientation.VERTICAL) {↵ | |
26 | line = new Line2D.Double(x0, y0, x1, y1);↵ | 26 | line = new Line2D.Double(x0, y0, x1, y1);↵ | |
27 | }↵ | 27 | }↵ | |
28 | g2.setPaint(getItemPaint(row, column));↵ | 28 | g2.setPaint(getItemPaint(row, column));↵ | |
29 | g2.setStroke(getItemStroke(row, column));↵ | 29 | g2.setStroke(getItemStroke(row, column));↵ | |
30 | g2.draw(line);↵ | 30 | g2.draw(line);↵ | |
31 | }↵ | 31 | }↵ | |
32 | } | 32 |
| |
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) | 1.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 105 |
Number of mapped statements | 17 |
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) | 97.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
16 | if (column != 0) | 32 | if (column != 0) | |||||||||||||||
17 | Number previousValue = dataset.getValue(row, column - 1); |
| 33 | Number previousValue = statData.getValue(row, column - 1); | ||||||||||||||
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 |