File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/frame/FrameManager.java | File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/profiles/ProfileManager.java | |||
Method name: ViewItem createCustomViewItem(String)
|
Method name: XmlElement getXmlElementForName(String)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | for (int i = 0; i < custom.count(); i++) {↵ | 1 | for (int i = 0; i < profiles.count(); i++) {↵ | |
2 | XmlElement child = custom.getElement(i);↵ | 2 | XmlElement profile = profiles.getElement(i);↵ | |
3 | String name = child.getAttribute("id");↵ | 3 | String n = profile.getAttribute("name");↵ | |
4 | if (name.equals(id))↵ | 4 | if (name.equals↵ | |
5 | return new ViewItem(child);↵ | 5 | IgnoreCase(n)) {↵ | |
6 | return profile;↵ | |||
7 | }↵ | |||
6 | } | 8 |
| |
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 different classes |
Number of node comparisons | 13 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | for (int i = 0; i < custom.count(); i++) |
| 1 | for (int i = 0; i < profiles.count(); i++) | ||||||||||||||||||
6 | XmlElement child = custom.getElement(i); |
| 2 | XmlElement profile = profiles.getElement(i); | ||||||||||||||||||
7 | String name = child.getAttribute("id"); |
| 3 | String n = profile.getAttribute("name"); | ||||||||||||||||||
8 | if (name.equals(id)) |
| 4 | if (name.equalsIgnoreCase(n)) | ||||||||||||||||||
|
| 5 | return profile; | |||||||||||||||||||
9 | return new ViewItem(child); |
| |
Row | Violation |
---|---|
1 | Expression name cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression n cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression n cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression name.equals(id) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression name.equalsIgnoreCase(n) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement return profile; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched return profile; |
8 | Unmatched statement return new ViewItem(child); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Unmatched return new ViewItem(child); |
10 | The refactoring of the clones is infeasible, because classes org.columba.core.gui.frame.FrameManager and org.columba.core.gui.profiles.ProfileManager do not have a common superclass |