File path: /jruby-1.4.0/src/org/jruby/RubyKernel.java | File path: /jruby-1.4.0/src/org/jruby/RubyKernel.java | |||
Method name: IRubyObject sub(ThreadContext, IRubyObject, IRubyObject, Block)
|
Method name: IRubyObject gsub(ThreadContext, IRubyObject, IRubyObject, Block)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | RubyString str = (RubyString) getLastlineString(context, context.getRuntime()).dup();↵ | 1 | RubyString str = (RubyString) getLastlineString(context, context.getRuntime()).dup();↵ | |
2 | if (!str.sub_bang(context, arg0, block).isNil()) {↵ | 2 | if (!str.gsub_bang(context, arg0, block).isNil()) {↵ | |
3 | context.getCurrentScope().setLastLine(str);↵ | 3 | context.getCurrentScope().setLastLine(str);↵ | |
4 | }↵ | 4 | }↵ | |
5 | return str; | 5 |
| |
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 | 8 |
Number of mapped statements | 4 |
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) | 5113.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | RubyString str = (RubyString)getLastlineString(context, context.getRuntime()).dup(); | 1 | RubyString str = (RubyString)getLastlineString(context, context.getRuntime()).dup(); | |||||||||||||
2 | if (!str.sub_bang(context, arg0, block).isNil()) |
| 2 | if (!str.gsub_bang(context, arg0, block).isNil()) | ||||||||||||
3 | context.getCurrentScope().setLastLine(str); | 3 | context.getCurrentScope().setLastLine(str); | |||||||||||||
4 | return str; | 4 | return str; |
Row | Violation |
---|---|
1 | Expression str.sub_bang(context,arg0,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression str.gsub_bang(context,arg0,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted |