File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/menu/MenuXMLDecoder.java | File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/menu/MenuXMLDecoder.java | |||
Method name: void extendMenu(ExtendableMenuBar, ExtendableMenu, Element, String)
|
Method name: void extendMenu(ExtendableMenuBar, ExtendableMenu, Element, String)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | String id = menuElement.getAttributeValue(MenuXMLDecoder.ID);↵ | 1 | String id = menuElement.getAttributeValue(MenuXMLDecoder.ID);↵ | |
2 | AbstractColumbaAction action = getAction(id, mediator);↵ | 2 | AbstractColumbaAction action = getAction(id, mediator);↵ | |
3 | if (action == null)↵ | 3 | if (action == null)↵ | |
4 | continue;↵ | 4 | continue;↵ | |
5 | CMenuItem menuItem = new CMenuItem(action);↵ | 5 | JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(action);↵ | |
6 | menuItem.addMouseListener(mediator.getMouseTooltipHandler());↵ | 6 | menuItem.addMouseListener(mediator.getMouseTooltipHandler());↵ | |
7 | parentMenu.insert(menuItem, placeholderId); | 7 |
| |
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.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 19 |
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) | 56.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
16 | String id = menuElement.getAttributeValue(MenuXMLDecoder.ID); | 32 | String id = menuElement.getAttributeValue(MenuXMLDecoder.ID); | |||||||||||||||||||
17 | AbstractColumbaAction action = getAction(id, mediator); | 33 | AbstractColumbaAction action = getAction(id, mediator); | |||||||||||||||||||
18 | if (action == null) | 34 | if (action == null) | |||||||||||||||||||
19 | continue; |
| 35 | continue; | ||||||||||||||||||
20 | CMenuItem menuItem = new CMenuItem(action); |
| 36 | JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(action); | ||||||||||||||||||
21 | menuItem.addMouseListener(mediator.getMouseTooltipHandler()); |
| 37 | menuItem.addMouseListener(mediator.getMouseTooltipHandler()); | ||||||||||||||||||
22 | parentMenu.insert(menuItem, placeholderId); |
| 38 | parentMenu.insert(menuItem, placeholderId); |
Row | Violation |
---|---|
1 | Statement continue; without innermost loop |
2 | Statement continue; without innermost loop |
3 | Expression new CMenuItem(action) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new JRadioButtonMenuItem(action) cannot be parameterized, because it has dependencies to/from statements that will be extracted |