File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/profiles/ProfileManager.java | File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/profiles/ProfileManager.java | |||
Method name: Profile promptForProfile()
|
Method name: Profile promptForProfile()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | profiles.addAttribute("dont_ask", new Boolean(d↵ | 1 | profiles.addAttribute("dont_ask", new Boolean(d↵ | |
2 | .isDontAskedSelected()).toString());↵ | 2 | .isDontAskedSelected()).toString());↵ | |
3 | // save to profiles.xml↵ | 3 | // save to profiles.xml↵ | |
4 | try {↵ | 4 | try {↵ | |
5 | xml.save();↵ | 5 | xml.save();↵ | |
6 | } catch (Exception e) {↵ | 6 | } catch (Exception e) {↵ | |
7 | e.printStackTrace();↵ | 7 | e.printStackTrace();↵ | |
8 | }↵ | 8 | }↵ | |
9 | return new Profile("Default", location); | 9 | return getProfileForName(profileName); | |
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.1 |
Clones location | Clones are in the same method |
Number of node comparisons | 8 |
Number of mapped statements | 4 |
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.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17 | profiles.addAttribute("dont_ask", new Boolean(d.isDontAskedSelected()).toString()); | 22 | profiles.addAttribute("dont_ask", new Boolean(d.isDontAskedSelected()).toString()); | ||||||||||||
18 | try | 23 | try | ||||||||||||
19 | xml.save(); | 24 | xml.save(); | ||||||||||||
20 | return new Profile("Default", location); |
| 25 | return getProfileForName(profileName); |
Row | Violation |
---|---|
1 | Expression getProfileForName(profileName) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Not all possible execution flows end in a return statement |