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: 10 | Number of AST nodes: 10 | |||
1 | Size2D[] sizes = new Size2D[blocks.size()];↵ | 1 | Size2D[] sizes = new Size2D[blocks.size()];↵ | |
2 | for (int i = 0; i < blocks.size(); i++) {↵ | 2 | for (int i = 0; i < blocks.size(); i++) {↵ | |
3 | Block block = (Block) blocks.get(i);↵ | 3 | Block block = (Block) blocks.get(i);↵ | |
4 | sizes[i] = block.arrange(g2, RectangleConstraint.NONE);↵ | 4 | sizes[i] = block.arrange(g2, RectangleConstraint.NONE);↵ | |
5 | height = height + sizes[i].getHeight();↵ | 5 | width = width + sizes[i].getWidth();↵ | |
6 | maxWidth = Math.max(sizes[i].width, maxWidth);↵ | 6 | maxHeight = Math.max(sizes[i].height, maxHeight);↵ | |
7 | block.setBounds(↵ | 7 | block.setBounds(↵ | |
8 | new Rectangle2D.Double(↵ | 8 | new Rectangle2D.Double(↵ | |
9 | 0.0, y, sizes[i].width, sizes[i].height↵ | 9 | x, 0.0, sizes[i].width, sizes[i].height↵ | |
10 | )↵ | 10 | )↵ | |
11 | );↵ | 11 | );↵ | |
12 | y = y + sizes[i].height + this.verticalGap;↵ | 12 | x = x + sizes[i].width + this.horizontalGap;↵ | |
13 | }↵ | 13 | }↵ | |
14 | if (blockCount > 1) {↵ | 14 | if (blockCount > 1) {↵ | |
15 | height = height + this.verticalGap * (blockCount - 1); ↵ | 15 | width = width + this.horizontalGap * (blockCount - 1); ↵ | |
16 | } | 16 |
| |
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.7 |
Clones location | Clones are in different classes |
Number of node comparisons | 57 |
Number of mapped statements | 10 |
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) | 19.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | Size2D[] sizes = new Size2D[blocks.size()]; | 7 | Size2D[] sizes = new Size2D[blocks.size()]; | ||||||||||||||||||||||
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; | |||||||||||||||||||||
15 | if (blockCount > 1) | 15 | if (blockCount > 1) | ||||||||||||||||||||||
16 | height = height + this.verticalGap * (blockCount - 1); |
| 16 | width = width + this.horizontalGap * (blockCount - 1); |
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 |