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: 13 | Number of AST nodes: 13 | |||
1 | case MailFilterCriteria.FROM: {↵ | 1 | case MailFilterCriteria.TO: {↵ | |
2 | if (operator == FilterCriteria.CONTAINS) {↵ | 2 | if (operator == FilterCriteria.CONTAINS) {↵ | |
3 | return new SearchKey(SearchKey.FROM, criteria↵ | 3 | return new SearchKey(SearchKey.TO, 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, ↵ | 8 | SearchKey.TO,↵ | |
9 | criteria.getPatternString()));↵ | 9 | criteria.getPatternString()));↵ | |
10 | }↵ | 10 | }↵ | |
11 | }↵ | 11 | }↵ | |
12 | case MailFilterCriteria.CC: {↵ | 12 | case MailFilterCriteria.SUBJECT: {↵ | |
13 | if (operator == FilterCriteria.CONTAINS) {↵ | 13 | if (operator == FilterCriteria.CONTAINS) {↵ | |
14 | return new SearchKey(SearchKey.CC, criteria↵ | 14 | return new SearchKey(SearchKey.SUBJECT, criteria↵ | |
15 | .getPatternString());↵ | 15 | .getPatternString());↵ | |
16 | } else {↵ | 16 | } else {↵ | |
17 | // contains not↵ | 17 | // contains not↵ | |
18 | return new SearchKey(SearchKey.NOT, new SearchKey(↵ | 18 | return new SearchKey(SearchKey.NOT, new SearchKey(↵ | |
19 | SearchKey.CC,↵ | 19 | SearchKey.↵ | |
20 | criteria.getPatternString()));↵ | 20 | SUBJECT, criteria.getPatternString()));↵ | |
21 | }↵ | 21 | }↵ | |
22 | }↵ | 22 | }↵ | |
23 | case MailFilterCriteria.BCC: {↵ | 23 | case MailFilterCriteria.BODY: {↵ | |
24 | if (operator == FilterCriteria.CONTAINS) {↵ | 24 | if (operator == FilterCriteria.CONTAINS) {↵ | |
25 | return new SearchKey(SearchKey.BCC, criteria↵ | 25 | return new SearchKey(SearchKey.BODY, criteria↵ | |
26 | .getPatternString());↵ | 26 | .getPatternString());↵ | |
27 | } else {↵ | 27 | } else {↵ | |
28 | // contains not↵ | 28 | // contains not↵ | |
29 | return new SearchKey(SearchKey.NOT, new SearchKey(↵ | 29 | return new SearchKey(SearchKey.NOT, new SearchKey(↵ | |
30 | SearchKey.BCC, criteria.getPatternString()));↵ | 30 | SearchKey.BODY, criteria.getPatternString()));↵ | |
31 | }↵ | 31 | }↵ | |
32 | }↵ | 32 | }↵ | |
33 | case MailFilterCriteria.TO: | 33 | case MailFilterCriteria.CUSTOM_HEADERFIELD: | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.7 |
Clones location | Clones are in the same method |
Number of node comparisons | 68 |
Number of mapped statements | 13 |
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.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | case MailFilterCriteria.FROM: |
| 16 | case MailFilterCriteria.TO: | ||||||||||
5 | if (operator == FilterCriteria.CONTAINS) | 17 | if (operator == FilterCriteria.CONTAINS) | |||||||||||
6 | return new SearchKey(SearchKey.FROM, criteria.getPatternString()); |
| 18 | return new SearchKey(SearchKey.TO, criteria.getPatternString()); | ||||||||||
else | else | |||||||||||||
7 | return new SearchKey(SearchKey.NOT, new SearchKey(SearchKey.FROM, criteria.getPatternString())); |
| 19 | return new SearchKey(SearchKey.NOT, new SearchKey(SearchKey.TO, criteria.getPatternString())); | ||||||||||
8 | case MailFilterCriteria.CC: |
| 20 | case MailFilterCriteria.SUBJECT: | ||||||||||
9 | if (operator == FilterCriteria.CONTAINS) | 21 | if (operator == FilterCriteria.CONTAINS) | |||||||||||
10 | return new SearchKey(SearchKey.CC, criteria.getPatternString()); |
| 22 | return new SearchKey(SearchKey.SUBJECT, criteria.getPatternString()); | ||||||||||
else | else | |||||||||||||
11 | return new SearchKey(SearchKey.NOT, new SearchKey(SearchKey.CC, criteria.getPatternString())); |
| 23 | return new SearchKey(SearchKey.NOT, new SearchKey(SearchKey.SUBJECT, criteria.getPatternString())); | ||||||||||
12 | case MailFilterCriteria.BCC: |
| 24 | case MailFilterCriteria.BODY: | ||||||||||
13 | if (operator == FilterCriteria.CONTAINS) | 25 | if (operator == FilterCriteria.CONTAINS) | |||||||||||
14 | return new SearchKey(SearchKey.BCC, criteria.getPatternString()); |
| 26 | return new SearchKey(SearchKey.BODY, criteria.getPatternString()); | ||||||||||
else | else | |||||||||||||
15 | return new SearchKey(SearchKey.NOT, new SearchKey(SearchKey.BCC, criteria.getPatternString())); |
| 27 | return new SearchKey(SearchKey.NOT, new SearchKey(SearchKey.BODY, criteria.getPatternString())); | ||||||||||
16 | case MailFilterCriteria.TO: |
| 28 | case MailFilterCriteria.CUSTOM_HEADERFIELD: |
Row | Violation |
---|