File path: /jruby-1.4.0/src/org/jruby/RubyStringScanner.java | File path: /jruby-1.4.0/src/org/jruby/RubyStringScanner.java | |||
Method name: IRubyObject matched_size()
|
Method name: IRubyObject matched(ThreadContext)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | check();↵ | 1 | check();↵ | |
2 | if (!isMatched()) return getRuntime().getNil();↵ | 2 | if (!isMatched()) return getRuntime().getNil(); ↵ | |
3 | return RubyFixnum.newFixnum(getRuntime(), end - beg); | 3 | return extractRange(context.getRuntime(), lastPos + beg, lastPos + end); | |
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
1 | check(); | 1 | check(); | ||||
2 | if (!isMatched()) | 2 | if (!isMatched()) | ||||
3 | return getRuntime().getNil(); | 3 | return getRuntime().getNil(); | ||||
|
| 4 | return extractRange(context.getRuntime(), lastPos + beg, lastPos + end); | ||||
4 | return RubyFixnum.newFixnum(getRuntime(), end - beg); |
| |
Row | Violation |
---|---|
1 | Unmatched return extractRange(context.getRuntime(),lastPos + beg,lastPos + end); |
2 | Unmatched return RubyFixnum.newFixnum(getRuntime(),end - beg); |