File path: /jruby-1.4.0/src/org/jruby/RubyMatchData.java | File path: /jruby-1.4.0/src/org/jruby/RubyMatchData.java | |||
Method name: IRubyObject begin19(ThreadContext, IRubyObject)
|
Method name: IRubyObject end19(ThreadContext, IRubyObject)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | int i = backrefNumber(index);↵ | 1 | int i = backrefNumber(index);↵ | |
2 | Ruby runtime = context.getRuntime();↵ | 2 | Ruby runtime = context.getRuntime();↵ | |
3 | int b = beginCommon(runtime, i);↵ | 3 | int e = endCommon(runtime, i);↵ | |
4 | if (b < 0) return runtime.getNil();↵ | 4 | if (e < 0) return runtime.getNil();↵ | |
5 | if (!str.singleByteOptimizable()) {↵ | 5 | if (!str.singleByteOptimizable()) {↵ | |
6 | updateCharOffset();↵ | 6 | updateCharOffset();↵ | |
7 | b = charOffsets.beg[i];↵ | 7 | e = charOffsets.end[i];↵ | |
8 | }↵ | 8 | }↵ | |
9 | return RubyFixnum.newFixnum(runtime, b); | 9 | return RubyFixnum.newFixnum(runtime, e); | |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 36 |
Number of mapped statements | 9 |
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.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | int i = backrefNumber(index); | 1 | int i = backrefNumber(index); | ||||||||||||||||
2 | Ruby runtime = context.getRuntime(); | 2 | Ruby runtime = context.getRuntime(); | ||||||||||||||||
3 | int b = beginCommon(runtime, i); |
| 3 | int e = endCommon(runtime, i); | |||||||||||||||
4 | if (b < 0) |
| 4 | if (e < 0) | |||||||||||||||
5 | return runtime.getNil(); | 5 | return runtime.getNil(); | ||||||||||||||||
6 | if (!str.singleByteOptimizable()) | 6 | if (!str.singleByteOptimizable()) | ||||||||||||||||
7 | updateCharOffset(); | 7 | updateCharOffset(); | ||||||||||||||||
8 | b = charOffsets.beg[i]; |
| 8 | e = charOffsets.end[i]; | |||||||||||||||
9 | return RubyFixnum.newFixnum(runtime, b); |
| 9 | return RubyFixnum.newFixnum(runtime, e); |
Row | Violation |
---|---|
1 | Expression beginCommon(runtime,i) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression endCommon(runtime,i) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression charOffsets.beg cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression charOffsets.end cannot be parameterized, because it has dependencies to/from statements that will be extracted |