File path: /jEdit-4.2/src/org/gjt/sp/jedit/EditPlugin.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/EditPlugin.java | |||
Method name: JMenuItem createMenuItems()
|
Method name: JMenuItem createBrowserMenuItems()
|
|||
Number of AST nodes: 11 | Number of AST nodes: 10 | |||
1 | if(this instanceof Broken)↵ | 1 | if(this instanceof Broken)↵ | |
2 | return null;↵ | 2 | return null;↵ | |
3 | String menuItemName = jEdit.getProperty("plugin." +↵ | 3 | String menuItemName = jEdit.getProperty("plugin." +↵ | |
4 | getClassName() + ".menu-item");↵ | 4 | getClassName() + ".browser-menu-item");↵ | |
5 | if(menuItemName != null)↵ | 5 | if(menuItemName != null)↵ | |
6 | ↵ | 6 | {↵ | |
7 | return GUIUtilities.loadMenuItem(menuItemName);↵ | 7 | return GUIUtilities.loadMenuItem(↵ | |
8 | String menuProperty = "plugin." + getClassName() + ".menu";↵ | |||
9 | String codeProperty = "plugin." + getClassName() + ".menu.code";↵ | |||
10 | if(jEdit.getProperty(menuProperty) != null↵ | |||
11 | || jEdit.getProperty(code↵ | |||
8 | VFSBrowser.getActionContext(),↵ | |||
9 | menuItemName,↵ | |||
10 | false);↵ | |||
11 | }↵ | |||
12 | String menuProperty = "plugin." + getClassName() + ".browser-menu";↵ | |||
12 | Property) != null)↵ | 13 | if(jEdit.getProperty(menuProperty) != null)↵ | |
13 | {↵ | 14 | {↵ | |
14 | String pluginName = jEdit.getProperty("plugin." +↵ | 15 | String pluginName = jEdit.getProperty("plugin." +↵ | |
15 | getClassName() + ".name");↵ | 16 | getClassName() + ".name");↵ | |
16 | return new EnhancedMenu(menuProperty,pluginName↵ | 17 | return new EnhancedMenu(menuProperty,pluginName,↵ | |
17 | );↵ | 18 | VFSBrowser.getActionContext());↵ | |
18 | }↵ | 19 | }↵ | |
19 | return null; | 20 |
| |
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 19 |
Number of mapped statements | 5 |
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) | 1.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (this instanceof Broken) | 1 | if (this instanceof Broken) | |||||||||||||
2 | return null; | 2 | return null; | |||||||||||||
3 | String menuItemName = jEdit.getProperty("plugin." + getClassName() + ".menu-item"); |
| 3 | String menuItemName = jEdit.getProperty("plugin." + getClassName() + ".browser-menu-item"); | ||||||||||||
4 | if (menuItemName != null) | 4 | if (menuItemName != null) | |||||||||||||
5 | return GUIUtilities.loadMenuItem(menuItemName); |
| 5 | return GUIUtilities.loadMenuItem(VFSBrowser.getActionContext(), menuItemName, false); |
Row | Violation |
---|---|
1 | Expression GUIUtilities.loadMenuItem(menuItemName) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression GUIUtilities.loadMenuItem(VFSBrowser.getActionContext(),menuItemName,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted |