File path: /jfreechart-1.0.10/src/org/jfree/chart/title/ImageTitle.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/title/ImageTitle.java | |||
Method name: Size2D drawHorizontal(Graphics2D, Rectangle2D)
|
Method name: Size2D drawVertical(Graphics2D, Rectangle2D)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | if (horizontalAlignment == HorizontalAlignment.CENTER) {↵ | 1 | if (alignment == VerticalAlignment.CENTER) {↵ | |
2 | startX = chartArea.getX() + leftSpace↵ | 2 | startY = chartArea.getMinY() + topSpace↵ | |
3 | + chartArea.getWidth() / 2.0↵ | 3 | + chartArea.getHeight() / 2.0↵ | |
4 | - w / 2.0;↵ | 4 | - h / 2.0;↵ | |
5 | }↵ | 5 | }↵ | |
6 | else if (horizontalAlignment == HorizontalAlignment.LEFT) {↵ | 6 | else if (alignment == VerticalAlignment.TOP) {↵ | |
7 | startX = chartArea.getX() + leftSpace;↵ | 7 | startY = chartArea.getMinY() + topSpace;↵ | |
8 | }↵ | 8 | }↵ | |
9 | else if (horizontalAlignment == HorizontalAlignment.RIGHT) {↵ | 9 | else if (alignment == VerticalAlignment.BOTTOM) {↵ | |
10 | startX = chartArea.getX() + chartArea.getWidth() - rightSpace - w;↵ | 10 | startY = chartArea.getMaxY() - bottomSpace - h;↵ | |
11 | } | 11 |
| |
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.8 |
Clones location | Clones are declared in the same class |
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) | 7.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18 | if (horizontalAlignment == HorizontalAlignment.CENTER) |
| 21 | if (alignment == VerticalAlignment.TOP) | |||||||||||||||||||||||||
19 | startX = chartArea.getX() + leftSpace + chartArea.getWidth() / 2.0 - w / 2.0; |
| 22 | startY = chartArea.getMinY() + topSpace; | |||||||||||||||||||||||||
20 | else if (horizontalAlignment == HorizontalAlignment.LEFT) |
| 19 | else if (alignment == VerticalAlignment.CENTER) | |||||||||||||||||||||||||
21 | startX = chartArea.getX() + leftSpace; |
| 20 | startY = chartArea.getMinY() + topSpace + chartArea.getHeight() / 2.0 - h / 2.0; | |||||||||||||||||||||||||
22 | else if (horizontalAlignment == HorizontalAlignment.RIGHT) |
| 23 | else if (alignment == VerticalAlignment.BOTTOM) | |||||||||||||||||||||||||
23 | startX = chartArea.getX() + chartArea.getWidth() - rightSpace - w; |
| 24 | startY = chartArea.getMaxY() - bottomSpace - h; |
Row | Violation |
---|---|
1 | Type org.jfree.ui.HorizontalAlignment of variable horizontalAlignment does not match with type org.jfree.ui.VerticalAlignment of variable alignment |
2 | Type org.jfree.ui.HorizontalAlignment does not match with type org.jfree.ui.VerticalAlignment |
3 | Type org.jfree.ui.HorizontalAlignment of variable HorizontalAlignment.CENTER does not match with type org.jfree.ui.VerticalAlignment of variable VerticalAlignment.TOP |
4 | Type org.jfree.ui.HorizontalAlignment of variable horizontalAlignment does not match with type org.jfree.ui.VerticalAlignment of variable alignment |
5 | Type org.jfree.ui.HorizontalAlignment does not match with type org.jfree.ui.VerticalAlignment |
6 | Type org.jfree.ui.HorizontalAlignment of variable HorizontalAlignment.LEFT does not match with type org.jfree.ui.VerticalAlignment of variable VerticalAlignment.CENTER |
7 | Type org.jfree.ui.HorizontalAlignment of variable horizontalAlignment does not match with type org.jfree.ui.VerticalAlignment of variable alignment |
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 |