File path: /jruby-1.4.0/src/org/jruby/RubyString.java | File path: /jruby-1.4.0/src/org/jruby/RubyString.java | |||
Method name: IRubyObject indexCommon19(Ruby, ThreadContext, IRubyObject, int)
|
Method name: IRubyObject rindexCommon(Ruby, ThreadContext, IRubyObject, int)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 4 | |||
1 | IRubyObject tmp = sub.checkStringType();↵ | 1 | IRubyObject tmp = sub.checkStringType();↵ | |
2 | if (tmp.isNil()) throw runtime.newTypeError("type mismatch: " + sub.getMetaClass().getName() + " given");↵ | 2 | if (tmp.isNil()) throw runtime.newTypeError("type mismatch: " + sub.getMetaClass().getName() + " given");↵ | |
3 | pos = strIndex19((RubyString) tmp, pos);↵ | 3 | pos = strRindex((RubyString) tmp, pos); | |
4 | pos = subLength(pos); | |||
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 11 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.4 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10 | IRubyObject tmp = sub.checkStringType(); | 25 | IRubyObject tmp = sub.checkStringType(); | |||||||||||||
11 | if (tmp.isNil()) | 26 | if (tmp.isNil()) | |||||||||||||
12 | throw runtime.newTypeError("type mismatch: " + sub.getMetaClass().getName() + " given"); | 27 | throw runtime.newTypeError("type mismatch: " + sub.getMetaClass().getName() + " given"); | |||||||||||||
13 | pos = strIndex19((RubyString)tmp, pos); |
| 28 | pos = strRindex((RubyString)tmp, pos); | ||||||||||||
14 | pos = subLength(pos); | |
Row | Violation |
---|---|
1 | Expression strIndex19((RubyString)tmp,pos) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression strRindex((RubyString)tmp,pos) cannot be parameterized, because it has dependencies to/from statements that will be extracted |