File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/imap/IMAPServer.java | File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/imap/IMAPServer.java | |||
Method name: SearchKey getSearchKey(IFilterCriteria)
|
Method name: SearchKey getSearchKey(IFilterCriteria)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | case MailFilterCriteria.FROM: {↵ | 1 | case MailFilterCriteria.SUBJECT: {↵ | |
2 | if (operator == FilterCriteria.CONTAINS) {↵ | 2 | if (operator == FilterCriteria.CONTAINS) {↵ | |
3 | return new SearchKey(SearchKey.FROM, criteria↵ | 3 | return new SearchKey(SearchKey.SUBJECT, criteria↵ | |
4 | .getPatternString());↵ | 4 | .getPatternString());↵ | |
5 | } else {↵ | 5 | } else {↵ | |
6 | // contains not↵ | 6 | // contains not↵ | |
7 | return new SearchKey(SearchKey.NOT, new SearchKey(↵ | 7 | return new SearchKey(SearchKey.NOT, new SearchKey(↵ | |
8 | SearchKey.FROM, criteria.getPatternString()));↵ | 8 | SearchKey.SUBJECT, criteria.getPatternString()));↵ | |
9 | }↵ | 9 | }↵ | |
10 | }↵ | 10 | }↵ | |
11 | case MailFilterCriteria.CC: {↵ | 11 | case MailFilterCriteria.BODY: {↵ | |
12 | if (operator == FilterCriteria.CONTAINS) {↵ | 12 | if (operator == FilterCriteria.CONTAINS) {↵ | |
13 | return new SearchKey(SearchKey.CC, criteria↵ | 13 | return new SearchKey(SearchKey.BODY, criteria↵ | |
14 | .getPatternString());↵ | 14 | .getPatternString());↵ | |
15 | } else {↵ | 15 | } else {↵ | |
16 | // contains not↵ | 16 | // contains not↵ | |
17 | return new SearchKey(SearchKey.NOT, new SearchKey(↵ | 17 | return new SearchKey(SearchKey.NOT, new SearchKey(↵ | |
18 | SearchKey.CC,↵ | 18 | SearchKey.↵ | |
19 | criteria.getPatternString()));↵ | 19 | BODY, criteria.getPatternString()));↵ | |
20 | } | 20 |
| |
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.5 |
Clones location | Clones are in the same method |
Number of node comparisons | 32 |
Number of mapped statements | 8 |
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) | 5.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | case MailFilterCriteria.FROM: |
| 20 | case MailFilterCriteria.SUBJECT: | ||||||||||||
5 | if (operator == FilterCriteria.CONTAINS) | 21 | if (operator == FilterCriteria.CONTAINS) | |||||||||||||
6 | return new SearchKey(SearchKey.FROM, criteria.getPatternString()); |
| 22 | return new SearchKey(SearchKey.SUBJECT, criteria.getPatternString()); | ||||||||||||
else | else | |||||||||||||||
7 | return new SearchKey(SearchKey.NOT, new SearchKey(SearchKey.FROM, criteria.getPatternString())); |
| 23 | return new SearchKey(SearchKey.NOT, new SearchKey(SearchKey.SUBJECT, criteria.getPatternString())); | ||||||||||||
8 | case MailFilterCriteria.CC: |
| 24 | case MailFilterCriteria.BODY: | ||||||||||||
9 | if (operator == FilterCriteria.CONTAINS) | 25 | if (operator == FilterCriteria.CONTAINS) | |||||||||||||
10 | return new SearchKey(SearchKey.CC, criteria.getPatternString()); |
| 26 | return new SearchKey(SearchKey.BODY, criteria.getPatternString()); | ||||||||||||
else | else | |||||||||||||||
11 | return new SearchKey(SearchKey.NOT, new SearchKey(SearchKey.CC, criteria.getPatternString())); |
| 27 | return new SearchKey(SearchKey.NOT, new SearchKey(SearchKey.BODY, criteria.getPatternString())); |
Row | Violation |
---|---|
1 | Switch case MailFilterCriteria.FROM: without corresponding switch |
2 | Switch case MailFilterCriteria.SUBJECT: without corresponding switch |
3 | Switch case MailFilterCriteria.CC: without corresponding switch |
4 | Switch case MailFilterCriteria.BODY: without corresponding switch |
5 | Not all possible execution flows end in a return statement |