File path: /columba-1.4-src/core/src/main/java/org/columba/core/util/NameParser.java | File path: /columba-1.4-src/core/src/main/java/org/columba/core/util/NameParser.java | |||
Method name: String findTitle(String)
|
Method name: String findSalutation(String)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | String title = null;↵ | 1 | String salutation = null;↵ | |
2 | for (String s : TITLES) {↵ | 2 | for (String s : SALUTATIONS) {↵ | |
3 | if (nameInputStr.endsWith(s)) {↵ | 3 | if (nameInputStr.startsWith(s)) {↵ | |
4 | title = s;↵ | 4 | salutation = s;↵ | |
5 | break;↵ | 5 | break;↵ | |
6 | }↵ | 6 | }↵ | |
7 | }↵ | 7 | }↵ | |
8 | return title; | 8 | return salutation; | |
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 declared in the same class |
Number of node comparisons | 14 |
Number of mapped statements | 6 |
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) | 0.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String title = null; |
| 1 | String salutation = null; | ||||||||||||
2 | for (String s : TITLES) |
| 2 | for (String s : SALUTATIONS) | ||||||||||||
3 | if (nameInputStr.endsWith(s)) |
| 3 | if (nameInputStr.startsWith(s)) | ||||||||||||
4 | title = s; |
| 4 | salutation = s; | ||||||||||||
5 | break; | 5 | break; | |||||||||||||
6 | return title; |
| 6 | return salutation; |
Row | Violation |
---|---|
1 | Expression nameInputStr.endsWith(s) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression nameInputStr.startsWith(s) cannot be parameterized, because it has dependencies to/from statements that will be extracted |