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: void layoutContainer(Container)
|
Method name: void layoutContainer(Container)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | for(int i = 2; i < comp.length; i++)↵ | 1 | for(int i = 2; i < comp.length; i++)↵ | |
2 | {↵ | 2 | {↵ | |
3 | int btnWidth = comp[i].getPreferredSize().width;↵ | 3 | int btnHeight = comp[i].getPreferredSize().height;↵ | |
4 | if(btnWidth + x > width)↵ | 4 | if(btnHeight + y > height)↵ | |
5 | {↵ | 5 | {↵ | |
6 | x = insets.left;↵ | 6 | x += colWidth;↵ | |
7 | y += rowHeight;↵ | 7 | y = insets.top;↵ | |
8 | }↵ | 8 | }↵ | |
9 | comp[i].setBounds(x,y,btnWidth,rowHeight);↵ | 9 | comp[i].setBounds(x,y,colWidth,btnHeight);↵ | |
10 | x += btnWidth;↵ | 10 | y += btnHeight;↵ | |
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.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 25 |
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) | 2.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17 | for (int i = 2; i < comp.length; i++) | 30 | for (int i = 2; i < comp.length; i++) | |||||||||||||||||||||
18 | int btnWidth = comp[i].getPreferredSize().width; |
| 31 | int btnHeight = comp[i].getPreferredSize().height; | ||||||||||||||||||||
19 | if (btnWidth + x > width) |
| 32 | if (btnHeight + y > height) | ||||||||||||||||||||
20 | x = insets.left; |
| 34 | y = insets.top; | ||||||||||||||||||||
21 | y += rowHeight; |
| 33 | x += colWidth; | ||||||||||||||||||||
22 | comp[i].setBounds(x, y, btnWidth, rowHeight); |
| 35 | comp[i].setBounds(x, y, colWidth, btnHeight); | ||||||||||||||||||||
23 | x += btnWidth; |
| 36 | y += btnHeight; |
Row | Violation |
---|---|
1 | Expression btnWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression btnHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression comp[i].getPreferredSize().width cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression comp[i].getPreferredSize().height cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression btnWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression btnHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression x cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression y cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression y cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression x cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression x cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression y cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression btnWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression btnHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted |