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 matchCharArray(Context, Op, int, int, int)
|
Method name: int matchString(Context, Op, int, int, int)
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | int o1 = offset-1;↵ | 1 | int o1 = offset-1;↵ | |
2 | if (o1 >= con.limit || o1 < 0)↵ | 2 | if (o1 >= con.limit || o1 < 0)↵ | |
3 | return -1;↵ | 3 | return -1;↵ | |
4 | int ch = target [ o1 ] ;↵ | 4 | int ch = target .charAt( o1 ) ;↵ | |
5 | if (isSet(opts, SINGLE_LINE)) {↵ | 5 | if (isSet(opts, SINGLE_LINE)) {↵ | |
6 | if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)↵ | 6 | if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)↵ | |
7 | o1 --;↵ | 7 | o1 --;↵ | |
8 | } else {↵ | 8 | } else {↵ | |
9 | if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)↵ | 9 | if (REUtil.isLowSurrogate(ch) && o1-1 >= 0)↵ | |
10 | ch = REUtil.composeFromSurrogates( target [ --o1 ] , ch);↵ | 10 | ch = REUtil.composeFromSurrogates( target .charAt( --o1 ) , ch);↵ | |
11 | if (!isEOLChar(ch))↵ | 11 | if (!isEOLChar(ch))↵ | |
12 | return -1;↵ | 12 | return -1;↵ | |
13 | }↵ | 13 | }↵ | |
14 | offset = o1; | 14 |
| |
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) | 2.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 49 |
Number of mapped statements | 12 |
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) | 21.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
43 | int o1 = offset - 1; | 43 | int o1 = offset - 1; | |||||||||||||
44 | if (o1 >= con.limit || o1 < 0) | 44 | if (o1 >= con.limit || o1 < 0) | |||||||||||||
45 | return -1; | 45 | return -1; | |||||||||||||
46 | int ch = target[o1]; |
| 46 | int ch = target.charAt(o1); | ||||||||||||
47 | if (isSet(opts, SINGLE_LINE)) | 47 | if (isSet(opts, SINGLE_LINE)) | |||||||||||||
48 | if (REUtil.isLowSurrogate(ch) && o1 - 1 >= 0) | 48 | if (REUtil.isLowSurrogate(ch) && o1 - 1 >= 0) | |||||||||||||
49 | o1--; | 49 | o1--; | |||||||||||||
else | else | |||||||||||||||
50 | if (REUtil.isLowSurrogate(ch) && o1 - 1 >= 0) | 50 | if (REUtil.isLowSurrogate(ch) && o1 - 1 >= 0) | |||||||||||||
51 | ch = REUtil.composeFromSurrogates(target[--o1], ch); |
| 51 | ch = REUtil.composeFromSurrogates(target.charAt(--o1), ch); | ||||||||||||
52 | if (!isEOLChar(ch)) | 52 | if (!isEOLChar(ch)) | |||||||||||||
53 | return -1; | 53 | return -1; | |||||||||||||
54 | offset = o1; | 54 | offset = o1; |
Row | Violation |
---|---|
1 | Expression target[o1] cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression target.charAt(o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression target[--o1] cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression target.charAt(--o1) cannot be parameterized, because it has dependencies to/from statements that will be extracted |