File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ValueAxis.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ValueAxis.java | |||
Method name: double findMaximumTickLabelHeight(List, Graphics2D, Rectangle2D, boolean)
|
Method name: double findMaximumTickLabelWidth(List, Graphics2D, Rectangle2D, boolean)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | while (iterator.hasNext()) {↵ | 1 | while (iterator.hasNext()) {↵ | |
2 | Tick tick = (Tick) iterator.next();↵ | 2 | Tick tick = (Tick) iterator.next();↵ | |
3 | Rectangle2D labelBounds = TextUtilities.getTextBounds(↵ | 3 | Rectangle2D labelBounds = TextUtilities.getTextBounds(↵ | |
4 | tick.getText(), g2, fm);↵ | 4 | tick.getText(), g2, fm);↵ | |
5 | if (labelBounds.getWidth() + insets.getTop()↵ | 5 | if (labelBounds.getWidth() + insets.getLeft()↵ | |
6 | + insets.getBottom() > maxHeight) {↵ | 6 | + insets.getRight() > maxWidth) {↵ | |
7 | maxHeight = labelBounds.getWidth()↵ | 7 | maxWidth = labelBounds.getWidth()↵ | |
8 | + insets.getTop() + insets.getBottom();↵ | 8 | + insets.getLeft() + insets.getRight();↵ | |
9 | }↵ | 9 | }↵ | |
10 | } | 10 |
| |
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) | 0.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 14 |
Number of mapped statements | 5 |
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) | 21.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | while (iterator.hasNext()) | 7 | while (iterator.hasNext()) | |||||||||||||||||||||
8 | Tick tick = (Tick)iterator.next(); | 8 | Tick tick = (Tick)iterator.next(); | |||||||||||||||||||||
9 | Rectangle2D labelBounds = TextUtilities.getTextBounds(tick.getText(), g2, fm); | 9 | Rectangle2D labelBounds = TextUtilities.getTextBounds(tick.getText(), g2, fm); | |||||||||||||||||||||
10 | if (labelBounds.getWidth() + insets.getTop() + insets.getBottom() > maxHeight) |
| 10 | if (labelBounds.getWidth() + insets.getLeft() + insets.getRight() > maxWidth) | ||||||||||||||||||||
11 | maxHeight = labelBounds.getWidth() + insets.getTop() + insets.getBottom(); |
| 11 | maxWidth = labelBounds.getWidth() + insets.getLeft() + insets.getRight(); |
Row | Violation |
---|---|
1 | Expression insets.getBottom() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression insets.getRight() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression insets.getTop() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression insets.getLeft() cannot be parameterized, because it has dependencies to/from statements that will be extracted |