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