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