File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/context/ContactContextualProvider.java | File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/context/ContactDetailsContextualProvider.java | |||
Method name: void search(ISemanticContext, int, int)
|
Method name: void search(ISemanticContext, int, int)
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
1 | IStructureValue identity = it.next();↵ | 1 | IStructureValue identity = it.next();↵ | |
2 | if (identity == null)↵ | 2 | if (identity == null)↵ | |
3 | return;↵ | 3 | return;↵ | |
4 | String emailAddress = identity.getString(↵ | 4 | String emailAddress = identity.getString(↵ | |
5 | ISemanticContext.CONTEXT_ATTR_EMAIL_ADDRESS,↵ | 5 | ISemanticContext.CONTEXT_ATTR_EMAIL_ADDRESS,↵ | |
6 | ISemanticContext.CONTEXT_NAMESPACE_CORE);↵ | 6 | ISemanticContext.CONTEXT_NAMESPACE_CORE);↵ | |
7 | String displayname = identity.getString(↵ | 7 | String displayname = identity.getString(↵ | |
8 | ISemanticContext.CONTEXT_ATTR_DISPLAY_NAME,↵ | 8 | ISemanticContext.CONTEXT_ATTR_DISPLAY_NAME,↵ | |
9 | ISemanticContext.CONTEXT_NAMESPACE_CORE);↵ | 9 | ISemanticContext.CONTEXT_NAMESPACE_CORE);↵ | |
10 | if (emailAddress == null && displayname == null)↵ | 10 | if (emailAddress == null && displayname == null)↵ | |
11 | return;↵ | 11 | return;↵ | |
12 | List<ISearchResult> temp;↵ | 12 | List<ISearchResult> temp;↵ | |
13 | if (emailAddress != null) {↵ | 13 | if (emailAddress != null) {↵ | |
14 | temp = searchProvider.query(emailAddress,↵ | 14 | temp = searchProvider.query(emailAddress,↵ | |
15 | ContactSearchProvider.CRITERIA_EMAIL_CONTAINS, false, ↵ | 15 | ContactSearchProvider.CRITERIA_EMAIL_CONTAINS, false,↵ | |
16 | 0, 5);↵ | 16 | 0, 5);↵ | |
17 | result.addAll(temp);↵ | 17 | result.addAll(temp);↵ | |
18 | }↵ | 18 | }↵ | |
19 | if (displayname != null) {↵ | 19 | if (displayname != null) {↵ | |
20 | temp = searchProvider.query(displayname,↵ | 20 | temp = searchProvider.query(displayname,↵ | |
21 | ContactSearchProvider.CRITERIA_DISPLAYNAME_CONTAINS, ↵ | 21 | ContactSearchProvider.CRITERIA_DISPLAYNAME_CONTAINS,↵ | |
22 | false, 0, 5);↵ | 22 | false, 0, 5);↵ | |
23 | result.addAll(temp);↵ | 23 | result.addAll(temp);↵ | |
24 | } | 24 | } | |
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) | 1.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 85 |
Number of mapped statements | 14 |
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) | 6.8 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |||||||
---|---|---|---|---|---|---|---|---|---|---|
5 | IStructureValue identity = it.next(); | 6 | IStructureValue identity = it.next(); | |||||||
6 | if (identity == null) | 7 | if (identity == null) | |||||||
7 | return; |
| 8 | return; | ||||||
8 | String emailAddress = identity.getString(ISemanticContext.CONTEXT_ATTR_EMAIL_ADDRESS, ISemanticContext.CONTEXT_NAMESPACE_CORE); | 9 | String emailAddress = identity.getString(ISemanticContext.CONTEXT_ATTR_EMAIL_ADDRESS, ISemanticContext.CONTEXT_NAMESPACE_CORE); | |||||||
9 | String displayname = identity.getString(ISemanticContext.CONTEXT_ATTR_DISPLAY_NAME, ISemanticContext.CONTEXT_NAMESPACE_CORE); | 10 | String displayname = identity.getString(ISemanticContext.CONTEXT_ATTR_DISPLAY_NAME, ISemanticContext.CONTEXT_NAMESPACE_CORE); | |||||||
10 | if (emailAddress == null && displayname == null) | 11 | if (emailAddress == null && displayname == null) | |||||||
11 | return; |
| 12 | return; | ||||||
12 | List<ISearchResult> temp; | 13 | List<ISearchResult> temp; | |||||||
13 | if (emailAddress != null) | 14 | if (emailAddress != null) | |||||||
14 | temp = searchProvider.query(emailAddress, ContactSearchProvider.CRITERIA_EMAIL_CONTAINS, false, 0, 5); | 15 | temp = searchProvider.query(emailAddress, ContactSearchProvider.CRITERIA_EMAIL_CONTAINS, false, 0, 5); | |||||||
15 | result.addAll(temp); | 16 | result.addAll(temp); | |||||||
16 | if (displayname != null) | 17 | if (displayname != null) | |||||||
17 | temp = searchProvider.query(displayname, ContactSearchProvider.CRITERIA_DISPLAYNAME_CONTAINS, false, 0, 5); | 18 | temp = searchProvider.query(displayname, ContactSearchProvider.CRITERIA_DISPLAYNAME_CONTAINS, false, 0, 5); | |||||||
18 | result.addAll(temp); | 19 | result.addAll(temp); |
Row | Violation |
---|---|
1 | Conditional return; |
2 | Conditional return; |
3 | Conditional return; |
4 | Conditional return; |