File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/RegEx.java | |||
Method name: int matchesIgnoreCase(String, int, int)
|
Method name: int matchesIgnoreCase(char[], int, int)
|
|||
Number of AST nodes: 16 | Number of AST nodes: 17 | |||
1 | while (index <= limit)↵ | |||
2 | {↵ | |||
1 | int pindex = plength;↵ | 3 | int pindex = plength;↵ | |
2 | int nindex = index + 1;↵ | 4 | int nindex = index + 1;↵ | |
3 | char ch;↵ | 5 | char ch;↵ | |
4 | do↵ | 6 | do↵ | |
5 | {↵ | 7 | {↵ | |
6 | char ch1 = ch = text.charAt(--index);↵ | 8 | char ch1 = ch = chars[--index];↵ | |
7 | char ch2 = this.pattern[--pindex];↵ | 9 | char ch2 = this.pattern[--pindex];↵ | |
8 | if (ch1 != ch2)↵ | 10 | if (ch1 != ch2)↵ | |
9 | {↵ | 11 | {↵ | |
10 | ch1 = Character.toUpperCase(ch1);↵ | 12 | ch1 = Character.toUpperCase(ch1);↵ | |
11 | ch2 = Character.toUpperCase(ch2);↵ | 13 | ch2 = Character.toUpperCase(ch2);↵ | |
12 | if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2))↵ | 14 | if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2))↵ | |
13 | break;↵ | 15 | break;↵ | |
14 | }↵ | 16 | }↵ | |
15 | if (pindex == 0)↵ | 17 | if (pindex == 0)↵ | |
16 | return index;↵ | 18 | return index;↵ | |
17 | }↵ | 19 | }↵ | |
18 | while (pindex > 0);↵ | 20 | while (pindex > 0);↵ | |
19 | index += this.shiftTable[ch % this.shiftTable.length] + 1;↵ | 21 | index += this.shiftTable[ch % this.shiftTable.length] + 1;↵ | |
20 | if (index < nindex)↵ | 22 | if (index < nindex)↵ | |
21 | index = nindex; | 23 | index = nindex;↵ | |
24 |
| |||
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 declared in the same class |
Number of node comparisons | 49 |
Number of mapped statements | 16 |
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) | 2.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6 | int pindex = plength; | 6 | int pindex = plength; | |||||||||||||
7 | int nindex = index + 1; | 7 | int nindex = index + 1; | |||||||||||||
8 | char ch; | 8 | char ch; | |||||||||||||
18 | do while(pindex > 0) | 18 | do while(pindex > 0) | |||||||||||||
9 | char ch1 = ch = text.charAt(--index); |
| 9 | char ch1 = ch = chars[--index]; | ||||||||||||
10 | char ch2 = this.pattern[--pindex]; | 10 | char ch2 = this.pattern[--pindex]; | |||||||||||||
11 | if (ch1 != ch2) | 11 | if (ch1 != ch2) | |||||||||||||
12 | ch1 = Character.toUpperCase(ch1); | 12 | ch1 = Character.toUpperCase(ch1); | |||||||||||||
13 | ch2 = Character.toUpperCase(ch2); | 13 | ch2 = Character.toUpperCase(ch2); | |||||||||||||
14 | if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2)) | 14 | if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2)) | |||||||||||||
15 | break; | 15 | break; | |||||||||||||
16 | if (pindex == 0) | 16 | if (pindex == 0) | |||||||||||||
17 | return index; | 17 | return index; | |||||||||||||
19 | index += this.shiftTable[ch % this.shiftTable.length] + 1; | 19 | index += this.shiftTable[ch % this.shiftTable.length] + 1; | |||||||||||||
20 | if (index < nindex) | 20 | if (index < nindex) | |||||||||||||
21 | index = nindex; | 21 | index = nindex; |
Row | Violation |
---|---|
1 | Expression text.charAt(--index) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression chars[--index] cannot be parameterized, because it has dependencies to/from statements that will be extracted |