File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartPanel.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartPanel.java | |||
Method name: void drawHorizontalAxisTrace(Graphics2D, int)
|
Method name: void drawVerticalAxisTrace(Graphics2D, int)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | Rectangle2D dataArea = getScreenDataArea();↵ | 1 | Rectangle2D dataArea = getScreenDataArea();↵ | |
2 | g2.setXORMode(Color.orange);↵ | 2 | g2.setXORMode(Color.orange);↵ | |
3 | if (((int) dataArea.getMinX() < x) && (x < (int) dataArea.getMaxX())) {↵ | 3 | if (((int) dataArea.getMinY() < y) && (y < (int) dataArea.getMaxY())) {↵ | |
4 | if (this.verticalTraceLine != null) {↵ | 4 | if (this.horizontalTraceLine != null) {↵ | |
5 | g2.draw(this.verticalTraceLine);↵ | 5 | g2.draw(this.horizontalTraceLine);↵ | |
6 | this.verticalTraceLine.setLine(x, (int) dataArea.getMinY(), x,↵ | 6 | this.horizontalTraceLine.setLine((int) dataArea.getMinX(), y,↵ | |
7 | (int) dataArea.getMaxY());↵ | 7 | (int) dataArea.getMaxX(), y);↵ | |
8 | }↵ | 8 | }↵ | |
9 | else {↵ | 9 | else {↵ | |
10 | this.verticalTraceLine = new Line2D.Float(x,↵ | 10 | this.horizontalTraceLine = new Line2D.Float(↵ | |
11 | (int) dataArea.getMinY(), x, (int) dataArea.getMaxY()↵ | 11 | (int) dataArea.getMinX(), y, (int) dataArea.getMaxX(),↵ | |
12 | );↵ | 12 | y);↵ | |
13 | }↵ | 13 | }↵ | |
14 | g2.draw(this.verticalTraceLine);↵ | 14 | g2.draw(this.horizontalTraceLine);↵ | |
15 | }↵ | 15 | }↵ | |
16 | // Reset to the default 'overwrite' mode↵ | 16 | // Reset to the default 'overwrite' mode↵ | |
17 | g2.setPaintMode(); | 17 |
| |
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.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 29 |
Number of mapped statements | 9 |
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) | 9.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Rectangle2D dataArea = getScreenDataArea(); | 1 | Rectangle2D dataArea = getScreenDataArea(); | |||||||||||||||||||||||||||||||
2 | g2.setXORMode(Color.orange); | 2 | g2.setXORMode(Color.orange); | |||||||||||||||||||||||||||||||
3 | if (((int)dataArea.getMinX() < x) && (x < (int)dataArea.getMaxX())) |
| 3 | if (((int)dataArea.getMinY() < y) && (y < (int)dataArea.getMaxY())) | ||||||||||||||||||||||||||||||
4 | if (this.verticalTraceLine != null) |
| 4 | if (this.horizontalTraceLine != null) | ||||||||||||||||||||||||||||||
5 | g2.draw(this.verticalTraceLine); |
| 5 | g2.draw(this.horizontalTraceLine); | ||||||||||||||||||||||||||||||
6 | this.verticalTraceLine.setLine(x, (int)dataArea.getMinY(), x, (int)dataArea.getMaxY()); |
| 6 | this.horizontalTraceLine.setLine((int)dataArea.getMinX(), y, (int)dataArea.getMaxX(), y); | ||||||||||||||||||||||||||||||
else | else | |||||||||||||||||||||||||||||||||
7 | this.verticalTraceLine = new Line2D.Float(x, (int)dataArea.getMinY(), x, (int)dataArea.getMaxY()); |
| 7 | this.horizontalTraceLine = new Line2D.Float((int)dataArea.getMinX(), y, (int)dataArea.getMaxX(), y); | ||||||||||||||||||||||||||||||
8 | g2.draw(this.verticalTraceLine); |
| 8 | g2.draw(this.horizontalTraceLine); | ||||||||||||||||||||||||||||||
9 | g2.setPaintMode(); | 9 | g2.setPaintMode(); |
Row | Violation |
---|---|
1 | Expression dataArea.getMinX() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression dataArea.getMinY() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression dataArea.getMaxX() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression dataArea.getMaxY() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression (int)dataArea.getMinX() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression (int)dataArea.getMinY() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression (int)dataArea.getMaxX() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression (int)dataArea.getMaxY() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression this.verticalTraceLine cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression this.horizontalTraceLine cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression this.verticalTraceLine is a field being modified, and thus it cannot be parameterized |
12 | Expression this.horizontalTraceLine is a field being modified, and thus it cannot be parameterized |
13 | Expression (int)dataArea.getMinX() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression (int)dataArea.getMinY() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Expression (int)dataArea.getMaxX() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
16 | Expression (int)dataArea.getMaxY() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
17 | Expression this.verticalTraceLine cannot be parameterized, because it has dependencies to/from statements that will be extracted |
18 | Expression this.horizontalTraceLine cannot be parameterized, because it has dependencies to/from statements that will be extracted |