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: 22 | Number of AST nodes: 22 | |||
1 | int plength = this.pattern.length;↵ | 1 | int plength = this.pattern.length;↵ | |
2 | if (plength == 0)↵ | 2 | if (plength == 0)↵ | |
3 | return start;↵ | 3 | return start;↵ | |
4 | int index = start + plength;↵ | 4 | int index = start + plength;↵ | |
5 | while (index <= limit)↵ | 5 | while (index <= limit)↵ | |
6 | {↵ | 6 | {↵ | |
7 | int pindex = plength;↵ | 7 | int pindex = plength;↵ | |
8 | int nindex = index + 1;↵ | 8 | int nindex = index + 1;↵ | |
9 | char ch;↵ | 9 | char ch;↵ | |
10 | do↵ | 10 | do↵ | |
11 | {↵ | 11 | {↵ | |
12 | char ch1 = ch = text.charAt(--index);↵ | 12 | char ch1 = ch = chars[--index];↵ | |
13 | char ch2 = this.pattern[--pindex];↵ | 13 | char ch2 = this.pattern[--pindex];↵ | |
14 | if (ch1 != ch2)↵ | 14 | if (ch1 != ch2)↵ | |
15 | {↵ | 15 | {↵ | |
16 | ch1 = Character.toUpperCase(ch1);↵ | 16 | ch1 = Character.toUpperCase(ch1);↵ | |
17 | ch2 = Character.toUpperCase(ch2);↵ | 17 | ch2 = Character.toUpperCase(ch2);↵ | |
18 | if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2))↵ | 18 | if (ch1 != ch2 && Character.toLowerCase(ch1) != Character.toLowerCase(ch2))↵ | |
19 | break;↵ | 19 | break;↵ | |
20 | }↵ | 20 | }↵ | |
21 | if (pindex == 0)↵ | 21 | if (pindex == 0)↵ | |
22 | return index;↵ | 22 | return index;↵ | |
23 | }↵ | 23 | }↵ | |
24 | while (pindex > 0);↵ | 24 | while (pindex > 0);↵ | |
25 | index += this.shiftTable[ch % this.shiftTable.length] + 1;↵ | 25 | index += this.shiftTable[ch % this.shiftTable.length] + 1;↵ | |
26 | if (index < nindex)↵ | 26 | if (index < nindex)↵ | |
27 | index = nindex;↵ | 27 | index = nindex;↵ | |
28 | }↵ | 28 | }↵ | |
29 | return -1; | 29 |
| |
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 | 70 |
Number of mapped statements | 22 |
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) | 3.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | int plength = this.pattern.length; | 1 | int plength = this.pattern.length; | |||||||||||||
2 | if (plength == 0) | 2 | if (plength == 0) | |||||||||||||
3 | return start; | 3 | return start; | |||||||||||||
4 | int index = start + plength; | 4 | int index = start + plength; | |||||||||||||
5 | while (index <= limit) | 5 | while (index <= limit) | |||||||||||||
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; | |||||||||||||
22 | return -1; | 22 | return -1; |
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 |