File path: /jfreechart-1.0.10/src/org/jfree/chart/block/ColumnArrangement.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/block/FlowArrangement.java | |||
Method name: Size2D arrangeNN(BlockContainer, Graphics2D)
|
Method name: Size2D arrangeNN(BlockContainer, Graphics2D)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | for (int i = 0; i < blocks.size(); i++) {↵ | 1 | for (int i = 0; i < blocks.size(); i++) {↵ | |
2 | Block block = (Block) blocks.get(i);↵ | 2 | Block block = (Block) blocks.get(i);↵ | |
3 | sizes[i] = block.arrange(g2, RectangleConstraint.NONE);↵ | 3 | sizes[i] = block.arrange(g2, RectangleConstraint.NONE);↵ | |
4 | height = height + sizes[i].getHeight();↵ | 4 | width = width + sizes[i].getWidth();↵ | |
5 | maxWidth = Math.max(sizes[i].width, maxWidth);↵ | 5 | maxHeight = Math.max(sizes[i].height, maxHeight);↵ | |
6 | block.setBounds(↵ | 6 | block.setBounds(↵ | |
7 | new Rectangle2D.Double(↵ | 7 | new Rectangle2D.Double(↵ | |
8 | 0.0, y, sizes[i].width, sizes[i].height↵ | 8 | x, 0.0, sizes[i].width, sizes[i].height↵ | |
9 | )↵ | 9 | )↵ | |
10 | );↵ | 10 | );↵ | |
11 | y = y + sizes[i].height + this.verticalGap;↵ | 11 | x = x + sizes[i].width + this.horizontalGap;↵ | |
12 | } | 12 |
| |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 50 |
Number of mapped statements | 7 |
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) | 54.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8 | for (int i = 0; i < blocks.size(); i++) | 8 | for (int i = 0; i < blocks.size(); i++) | ||||||||||||||||||||||
9 | Block block = (Block)blocks.get(i); | 9 | Block block = (Block)blocks.get(i); | ||||||||||||||||||||||
10 | sizes[i] = block.arrange(g2, RectangleConstraint.NONE); | 10 | sizes[i] = block.arrange(g2, RectangleConstraint.NONE); | ||||||||||||||||||||||
11 | height = height + sizes[i].getHeight(); |
| 11 | width = width + sizes[i].getWidth(); | |||||||||||||||||||||
12 | maxWidth = Math.max(sizes[i].width, maxWidth); |
| 12 | maxHeight = Math.max(sizes[i].height, maxHeight); | |||||||||||||||||||||
13 | block.setBounds(new Rectangle2D.Double(0.0, y, sizes[i].width, sizes[i].height)); |
| 13 | block.setBounds(new Rectangle2D.Double(x, 0.0, sizes[i].width, sizes[i].height)); | |||||||||||||||||||||
14 | y = y + sizes[i].height + this.verticalGap; |
| 14 | x = x + sizes[i].width + this.horizontalGap; |
Row | Violation |
---|---|
1 | Expression sizes[i].getHeight() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression sizes[i].getWidth() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression sizes[i].width cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression sizes[i].height cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression x cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression y cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression sizes[i].height cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression sizes[i].width cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Clone fragment #1 returns variables height, maxWidth , while Clone fragment #2 returns variables width, maxHeight |