File path: /jfreechart-1.0.10/src/org/jfree/chart/JFreeChart.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/JFreeChart.java | |||
Method name: Rectangle2D createAlignedRectangle2D(Size2D, Rectangle2D, HorizontalAlignment, VerticalAlignment)
|
Method name: Rectangle2D createAlignedRectangle2D(Size2D, Rectangle2D, HorizontalAlignment, VerticalAlignment)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | if (hAlign == HorizontalAlignment.LEFT) {↵ | 1 | if (vAlign == VerticalAlignment.TOP) {↵ | |
2 | x = frame.getX();↵ | 2 | y = frame.getY();↵ | |
3 | }↵ | 3 | }↵ | |
4 | else if (hAlign == HorizontalAlignment.CENTER) {↵ | 4 | else if (vAlign == VerticalAlignment.CENTER) {↵ | |
5 | x = frame.getCenterX() - (dimensions.width / 2.0);↵ | 5 | y = frame.getCenterY() - (dimensions.height / 2.0);↵ | |
6 | }↵ | 6 | }↵ | |
7 | else if (hAlign == HorizontalAlignment.RIGHT) {↵ | 7 | else if (vAlign == VerticalAlignment.BOTTOM) {↵ | |
8 | x = frame.getMaxX() - dimensions.width;↵ | 8 | y = frame.getMaxY() - dimensions.height;↵ | |
9 | } | 9 |
| |
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) | 1.0 |
Clones location | Clones are in the same method |
Number of node comparisons | 27 |
Number of mapped statements | 6 |
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) | 5.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | if (hAlign == HorizontalAlignment.LEFT) |
| 9 | if (vAlign == VerticalAlignment.TOP) | |||||||||||||||||||||||||
4 | x = frame.getX(); |
| 10 | y = frame.getY(); | |||||||||||||||||||||||||
5 | else if (hAlign == HorizontalAlignment.CENTER) |
| 11 | else if (vAlign == VerticalAlignment.CENTER) | |||||||||||||||||||||||||
6 | x = frame.getCenterX() - (dimensions.width / 2.0); |
| 12 | y = frame.getCenterY() - (dimensions.height / 2.0); | |||||||||||||||||||||||||
7 | else if (hAlign == HorizontalAlignment.RIGHT) |
| 13 | else if (vAlign == VerticalAlignment.BOTTOM) | |||||||||||||||||||||||||
8 | x = frame.getMaxX() - dimensions.width; |
| 14 | y = frame.getMaxY() - dimensions.height; |
Row | Violation |
---|---|
1 | Type org.jfree.ui.HorizontalAlignment of variable hAlign does not match with type org.jfree.ui.VerticalAlignment of variable vAlign |
2 | Type org.jfree.ui.HorizontalAlignment does not match with type org.jfree.ui.VerticalAlignment |
3 | Type org.jfree.ui.HorizontalAlignment of variable HorizontalAlignment.LEFT does not match with type org.jfree.ui.VerticalAlignment of variable VerticalAlignment.TOP |
4 | Type org.jfree.ui.HorizontalAlignment of variable hAlign does not match with type org.jfree.ui.VerticalAlignment of variable vAlign |
5 | Type org.jfree.ui.HorizontalAlignment does not match with type org.jfree.ui.VerticalAlignment |
6 | Type org.jfree.ui.HorizontalAlignment of variable HorizontalAlignment.CENTER does not match with type org.jfree.ui.VerticalAlignment of variable VerticalAlignment.CENTER |
7 | Type org.jfree.ui.HorizontalAlignment of variable hAlign does not match with type org.jfree.ui.VerticalAlignment of variable vAlign |
8 | Type org.jfree.ui.HorizontalAlignment does not match with type org.jfree.ui.VerticalAlignment |
9 | Type org.jfree.ui.HorizontalAlignment of variable HorizontalAlignment.RIGHT does not match with type org.jfree.ui.VerticalAlignment of variable VerticalAlignment.BOTTOM |