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: 13 | Number of AST nodes: 13 | |||
1 | int width = parent.getWidth() - insets.right;↵ | 1 | int height = parent.getHeight() - insets.bottom;↵ | |
2 | int rowHeight = Math.max(dim.height,closeBox.getPreferredSize().width);↵ | 2 | int colWidth = Math.max(dim.width,closeBox.getPreferredSize().height);↵ | |
3 | int x = rowHeight * 2 + insets.left;↵ | 3 | int x = insets.left;↵ | |
4 | int y = insets.top;↵ | 4 | int y = colWidth * 2 + insets.top;↵ | |
5 | closeBox.setBounds(insets.left,insets.top,rowHeight,rowHeight);↵ | 5 | closeBox.setBounds(insets.left,insets.top,colWidth,colWidth);↵ | |
6 | menuBtn.setBounds(insets.left + rowHeight,insets.top,rowHeight,rowHeight);↵ | 6 | menuBtn.setBounds(insets.left,insets.top + colWidth,colWidth,colWidth);↵ | |
7 | for(int i = 2; i < comp.length; i++)↵ | 7 | for(int i = 2; i < comp.length; i++)↵ | |
8 | {↵ | 8 | {↵ | |
9 | int btnWidth = comp[i].getPreferredSize().width;↵ | 9 | int btnHeight = comp[i].getPreferredSize().height;↵ | |
10 | if(btnWidth + x > width)↵ | 10 | if(btnHeight + y > height)↵ | |
11 | {↵ | 11 | {↵ | |
12 | x = insets.left;↵ | 12 | x += colWidth;↵ | |
13 | y += rowHeight;↵ | 13 | y = insets.top;↵ | |
14 | }↵ | 14 | }↵ | |
15 | comp[i].setBounds(x,y,btnWidth,rowHeight);↵ | 15 | comp[i].setBounds(x,y,colWidth,btnHeight);↵ | |
16 | x += btnWidth;↵ | 16 | y += btnHeight;↵ | |
17 | } | 17 |
| |
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) | 1.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 61 |
Number of mapped statements | 13 |
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.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11 | int width = parent.getWidth() - insets.right; |
| 24 | int height = parent.getHeight() - insets.bottom; | |||||||||||||||||||||||||
12 | int rowHeight = Math.max(dim.height, closeBox.getPreferredSize().width); |
| 25 | int colWidth = Math.max(dim.width, closeBox.getPreferredSize().height); | |||||||||||||||||||||||||
13 | int x = rowHeight * 2 + insets.left; |
| 27 | int y = colWidth * 2 + insets.top; | |||||||||||||||||||||||||
14 | int y = insets.top; |
| 26 | int x = insets.left; | |||||||||||||||||||||||||
15 | closeBox.setBounds(insets.left, insets.top, rowHeight, rowHeight); |
| 28 | closeBox.setBounds(insets.left, insets.top, colWidth, colWidth); | |||||||||||||||||||||||||
16 | menuBtn.setBounds(insets.left + rowHeight, insets.top, rowHeight, rowHeight); |
| 29 | menuBtn.setBounds(insets.left, insets.top + colWidth, colWidth, colWidth); | |||||||||||||||||||||||||
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 rowHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression colWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression rowHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression colWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression rowHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression colWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression insets.left + rowHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression insets.top + colWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression rowHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression colWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression rowHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression colWidth 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 |
15 | Expression comp[i].getPreferredSize().width cannot be parameterized, because it has dependencies to/from statements that will be extracted |
16 | Expression comp[i].getPreferredSize().height cannot be parameterized, because it has dependencies to/from statements that will be extracted |
17 | Expression btnWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted |
18 | Expression btnHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted |
19 | Expression x cannot be parameterized, because it has dependencies to/from statements that will be extracted |
20 | Expression y cannot be parameterized, because it has dependencies to/from statements that will be extracted |
21 | Expression x cannot be parameterized, because it has dependencies to/from statements that will be extracted |
22 | Expression y cannot be parameterized, because it has dependencies to/from statements that will be extracted |
23 | Expression y cannot be parameterized, because it has dependencies to/from statements that will be extracted |
24 | Expression x cannot be parameterized, because it has dependencies to/from statements that will be extracted |
25 | Expression rowHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted |
26 | Expression colWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted |
27 | Expression x cannot be parameterized, because it has dependencies to/from statements that will be extracted |
28 | Expression y cannot be parameterized, because it has dependencies to/from statements that will be extracted |
29 | Expression btnWidth cannot be parameterized, because it has dependencies to/from statements that will be extracted |
30 | Expression btnHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted |