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/pop3/POP3Store.java | |||
Method name: int getLoginMethod()
|
Method name: int getLoginMethod()
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | String loginMethod = item.get("login_method");↵ | 1 | String loginMethod = popItem.get("login_method");↵ | |
2 | int result = 0;↵ | 2 | int result = 0;↵ | |
3 | try {↵ | 3 | try {↵ | |
4 | result = Integer.parseInt(loginMethod);↵ | 4 | result = Integer.parseInt(loginMethod);↵ | |
5 | } catch (NumberFormatException e) {↵ | 5 | } catch (NumberFormatException e) {↵ | |
6 | // Just use the default as fallback↵ | 6 | // Just use the default as fallback↵ | |
7 | }↵ | 7 | }↵ | |
8 | if (result == 0) {↵ | 8 | if (result == 0) {↵ | |
9 | List supported = checkSupportedAuthenticationMethods();↵ | 9 | List supported = checkSupportedAuthenticationMethods();↵ | |
10 | if (usingSSL) {↵ | 10 | if (usingSSL) {↵ | |
11 | // NOTE if SSL is possible we just need the plain login↵ | 11 | // NOTE if SSL is possible we just need the plain login↵ | |
12 | // since SSL does the encryption for us.↵ | 12 | // since SSL does the encryption for us.↵ | |
13 | result = ((Integer) supported.get(0)).intValue();↵ | 13 | result = ((Integer) supported.get(0)).intValue();↵ | |
14 | } else {↵ | 14 | } else {↵ | |
15 | Collections.sort(supported,↵ | 15 | Collections.sort(supported,↵ | |
16 | new AuthenticationSecurityComparator());↵ | 16 | new AuthenticationSecurityComparator());↵ | |
17 | result = ((Integer) supported.get(supported.size() - 1))↵ | 17 | result = ((Integer) supported.get(supported.size() - 1))↵ | |
18 | .intValue();↵ | 18 | .intValue();↵ | |
19 | }↵ | 19 | }↵ | |
20 | }↵ | 20 | }↵ | |
21 | return result; | 21 |
| |
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.9 |
Clones location | Clones are in different classes |
Number of node comparisons | 33 |
Number of mapped statements | 11 |
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.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String loginMethod = item.get("login_method"); |
| 1 | String loginMethod = popItem.get("login_method"); | |||||||||||||
2 | int result = 0; | 2 | int result = 0; | ||||||||||||||
3 | try | 3 | try | ||||||||||||||
4 | result = Integer.parseInt(loginMethod); | 4 | result = Integer.parseInt(loginMethod); | ||||||||||||||
5 | if (result == 0) | 5 | if (result == 0) | ||||||||||||||
6 | List supported = checkSupportedAuthenticationMethods(); | 6 | List supported = checkSupportedAuthenticationMethods(); | ||||||||||||||
7 | if (usingSSL) | 7 | if (usingSSL) | ||||||||||||||
8 | result = ((Integer)supported.get(0)).intValue(); | 8 | result = ((Integer)supported.get(0)).intValue(); | ||||||||||||||
else | else | ||||||||||||||||
9 | Collections.sort(supported, new AuthenticationSecurityComparator()); | 9 | Collections.sort(supported, new AuthenticationSecurityComparator()); | ||||||||||||||
10 | result = ((Integer)supported.get(supported.size() - 1)).intValue(); | 10 | result = ((Integer)supported.get(supported.size() - 1)).intValue(); | ||||||||||||||
11 | return result; | 11 | return result; |
Row | Violation |
---|