File path: /jruby-1.4.0/src/org/jruby/RubyRegexp.java | File path: /jruby-1.4.0/src/org/jruby/RubyRegexp.java | |||
Method name: IRubyObject to_s()
|
Method name: IRubyObject to_s()
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | do {↵ | 1 | do {↵ | |
2 | if (bytes[p] == 'm') {↵ | 2 | if (bytes[p] == 'm') {↵ | |
3 | options &= ~RE_OPTION_MULTILINE;↵ | 3 | options |= RE_OPTION_MULTILINE;↵ | |
4 | } else if (bytes[p] == 'i') {↵ | 4 | } else if (bytes[p] == 'i') {↵ | |
5 | options &= ~RE_OPTION_IGNORECASE;↵ | 5 | options |= RE_OPTION_IGNORECASE;↵ | |
6 | } else if (bytes[p] == 'x') {↵ | 6 | } else if (bytes[p] == 'x') {↵ | |
7 | options &= ~RE_OPTION_EXTENDED;↵ | 7 | options |= RE_OPTION_EXTENDED;↵ | |
8 | } else {↵ | 8 | } else {↵ | |
9 | break;↵ | 9 | break;↵ | |
10 | }↵ | 10 | }↵ | |
11 | p++;↵ | 11 | p++;↵ | |
12 | } while (--len > 0); | 12 |
| |
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) | 1.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 45 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
32 | do while(--len > 0) | 20 | do while(--len > 0) | ||||
24 | if (bytes[p] == 'm') | 12 | if (bytes[p] == 'm') | ||||
|
| 13 | options |= RE_OPTION_MULTILINE; | ||||
25 | options &= ~RE_OPTION_MULTILINE; |
| | ||||
26 | else if (bytes[p] == 'i') | 14 | else if (bytes[p] == 'i') | ||||
|
| 15 | options |= RE_OPTION_IGNORECASE; | ||||
27 | options &= ~RE_OPTION_IGNORECASE; |
| | ||||
28 | else if (bytes[p] == 'x') | 16 | else if (bytes[p] == 'x') | ||||
|
| 17 | options |= RE_OPTION_EXTENDED; | ||||
29 | options &= ~RE_OPTION_EXTENDED; |
| | ||||
else | else | ||||||
30 | break; | 18 | break; | ||||
31 | p++; | 19 | p++; |
Row | Violation |
---|---|
1 | Unmatched statement options|=RE_OPTION_MULTILINE; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement options&=~RE_OPTION_MULTILINE; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement options|=RE_OPTION_IGNORECASE; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement options&=~RE_OPTION_IGNORECASE; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement options|=RE_OPTION_EXTENDED; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement options&=~RE_OPTION_EXTENDED; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Clone fragment #1 returns variables len, p , while Clone fragment #2 returns variables len, p |