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: void initializePath(String, int)
|
Method name: void setUserinfo(String)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | while (index < end) {↵ | |||
1 | testChar = p_uriSpec.charAt(index);↵ | 2 | testChar = p_userinfo.charAt(index);↵ | |
2 | if (testChar == '%') {↵ | 3 | if (testChar == '%') {↵ | |
3 | if (index+2 >= end ||↵ | 4 | if (index+2 >= end ||↵ | |
4 | !isHex(p_uriSpec.charAt(index+1)) ||↵ | 5 | !isHex(p_userinfo.charAt(index+1)) ||↵ | |
5 | !isHex(p_uriSpec.charAt(index+2))) {↵ | 6 | !isHex(p_userinfo.charAt(index+2))) {↵ | |
6 | throw new MalformedURIException(↵ | 7 | throw new MalformedURIException(↵ | |
7 | "Fragment contains invalid escape sequence!");↵ | 8 | "Userinfo contains invalid escape sequence!");↵ | |
8 | }↵ | 9 | }↵ | |
9 | index += 2;↵ | |||
10 | }↵ | 10 | }↵ | |
11 | else if (!isURICharacter(testChar)) {↵ | 11 | else if (!isUserinfoCharacter(testChar)) {↵ | |
12 | throw new MalformedURIException(↵ | 12 | throw new MalformedURIException(↵ | |
13 | "Fragment contains invalid character: "+testChar);↵ | 13 | "Userinfo contains invalid character:"+testChar);↵ | |
14 | }↵ | 14 | }↵ | |
15 | index++; | 15 | index++;↵ | |
16 |
| |||
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.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 18 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
51 | testChar = p_uriSpec.charAt(index); |
| 10 | testChar = p_userinfo.charAt(index); | |||||||||||||
52 | if (testChar == '%') | 11 | if (testChar == '%') | ||||||||||||||
53 | if (index + 2 >= end || !isHex(p_uriSpec.charAt(index + 1)) || !isHex(p_uriSpec.charAt(index + 2))) |
| 12 | if (index + 2 >= end || !isHex(p_userinfo.charAt(index + 1)) || !isHex(p_userinfo.charAt(index + 2))) | |||||||||||||
54 | throw new MalformedURIException("Fragment contains invalid escape sequence!"); |
| 13 | throw new MalformedURIException("Userinfo contains invalid escape sequence!"); | |||||||||||||
55 | index += 2; |
| | ||||||||||||||
56 | else if (!isURICharacter(testChar)) |
| 14 | else if (!isUserinfoCharacter(testChar)) | |||||||||||||
57 | throw new MalformedURIException("Fragment contains invalid character: " + testChar); |
| 15 | throw new MalformedURIException("Userinfo contains invalid character:" + testChar); | |||||||||||||
58 | index++; | 16 | index++; |
Row | Violation |
---|---|
1 | Unmatched statement index+=2; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Expression isURICharacter(testChar) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression isUserinfoCharacter(testChar) cannot be parameterized, because it has dependencies to/from statements that will be extracted |