File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/PanelWindowContainer.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/PanelWindowContainer.java | |||
Method name: int getWrappedDimension(JComponent, int)
|
Method name: int getWrappedDimension(JComponent, int)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | for(int i = 2; i < comp.length; i++)↵ | 1 | for(int i = 2; i < comp.length; i++)↵ | |
2 | {↵ | 2 | {↵ | |
3 | int btnHeight = comp[i].getPreferredSize().height;↵ | 3 | int btnWidth = comp[i].getPreferredSize().width;↵ | |
4 | if(btnHeight + y > height)↵ | 4 | if(btnWidth + x > width)↵ | |
5 | {↵ | 5 | {↵ | |
6 | returnValue.width += colWidth;↵ | 6 | returnValue.height += rowHeight;↵ | |
7 | y = insets.top;↵ | 7 | x = insets.left;↵ | |
8 | }↵ | 8 | }↵ | |
9 | y += btnHeight;↵ | 9 | x += btnWidth;↵ | |
10 | } | 10 |
| |
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.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 18 |
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) | 3.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
22 | for (int i = 2; i < comp.length; i++) | 11 | for (int i = 2; i < comp.length; i++) | |||||||||||||||||
23 | int btnHeight = comp[i].getPreferredSize().height; |
| 12 | int btnWidth = comp[i].getPreferredSize().width; | ||||||||||||||||
24 | if (btnHeight + y > height) |
| 13 | if (btnWidth + x > width) | ||||||||||||||||
25 | returnValue.width += colWidth; |
| 14 | returnValue.height += rowHeight; | ||||||||||||||||
26 | y = insets.top; |
| 15 | x = insets.left; | ||||||||||||||||
27 | y += btnHeight; |
| 16 | x += btnWidth; |
Row | Violation |
---|---|
1 | Expression comp[i].getPreferredSize().height cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression comp[i].getPreferredSize().width cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression returnValue.width cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression returnValue.height cannot be parameterized, because it has dependencies to/from statements that will be extracted |