File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/DataValue.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/DataValue.java | |||
Method name: boolean isValidServerBasedAuthority(String, int, String)
|
Method name: boolean isValidRegistryBasedAuthority(String)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | while (index < end) {↵ | 1 | while (index < end) {↵ | |
2 | testChar = userinfo.charAt(index);↵ | 2 | testChar = authority.charAt(index);↵ | |
3 | ↵ | 3 | ↵ | |
4 | // check for valid escape sequence↵ | |||
4 | if (testChar == '%') {↵ | 5 | if (testChar == '%') {↵ | |
5 | if (index+2 >= end ||↵ | 6 | if (index+2 >= end ||↵ | |
6 | !isHex(userinfo.charAt(index+1)) ||↵ | 7 | !isHex(authority.charAt(index+1)) ||↵ | |
7 | !isHex(userinfo.charAt(index+2))) {↵ | 8 | !isHex(authority.charAt(index+2))) {↵ | |
8 | return false;↵ | 9 | return false;↵ | |
9 | }↵ | 10 | ↵ | |
10 | ↵ | 11 | }↵ | |
11 | index += 2;↵ | 12 | index += 2;↵ | |
12 | }↵ | 13 | }↵ | |
13 | ↵ | 14 | // can check against path characters because the set↵ | |
15 | // is the same except for '/' which we've already excluded.↵ | |||
14 | else if (!isUserinfoCharacter(testChar)) {↵ | 16 | else if (!isPathCharacter(testChar)) {↵ | |
15 | return false;↵ | 17 | return false;↵ | |
16 | }↵ | 18 | }↵ | |
17 | ++index;↵ | 19 | ++index;↵ | |
18 | } | 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.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 21 |
Number of mapped statements | 9 |
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) | 1.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9 | while (index < end) | 4 | while (index < end) | ||||||||||||||
10 | testChar = userinfo.charAt(index); |
| 5 | testChar = authority.charAt(index); | |||||||||||||
11 | if (testChar == '%') | 6 | if (testChar == '%') | ||||||||||||||
12 | if (index + 2 >= end || !isHex(userinfo.charAt(index + 1)) || !isHex(userinfo.charAt(index + 2))) |
| 7 | if (index + 2 >= end || !isHex(authority.charAt(index + 1)) || !isHex(authority.charAt(index + 2))) | |||||||||||||
13 | return false; | 8 | return false; | ||||||||||||||
14 | index += 2; | 9 | index += 2; | ||||||||||||||
15 | else if (!isUserinfoCharacter(testChar)) |
| 10 | else if (!isPathCharacter(testChar)) | |||||||||||||
16 | return false; | 11 | return false; | ||||||||||||||
17 | ++index; | 12 | ++index; |
Row | Violation |
---|---|
1 | Expression isUserinfoCharacter(testChar) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression isPathCharacter(testChar) cannot be parameterized, because it has dependencies to/from statements that will be extracted |