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