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 chomp(ThreadContext, IRubyObject, IRubyObject)
|
Method name: IRubyObject chomp(ThreadContext, IRubyObject, IRubyObject[], Block)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | RubyString str = getLastlineString(context, context.getRuntime());↵ | 1 | RubyString str = getLastlineString(context, context.getRuntime());↵ | |
2 | RubyString dup = (RubyString) str.dup();↵ | 2 | RubyString dup = (RubyString) str.dup();↵ | |
3 | if (dup.chomp_bang(context, arg0).isNil()) {↵ | 3 | if (dup.chomp_bang(args).isNil()) {↵ | |
4 | return str;↵ | 4 | return str;↵ | |
5 | } ↵ | 5 | } ↵ | |
6 | context.getCurrentScope().setLastLine(dup);↵ | 6 | context.getCurrentScope().setLastLine(dup);↵ | |
7 | return dup; | 7 |
| |
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 | 20 |
Number of mapped statements | 6 |
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) | 1.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | RubyString str = getLastlineString(context, context.getRuntime()); | 1 | RubyString str = getLastlineString(context, context.getRuntime()); | |||||||||||||
2 | RubyString dup = (RubyString)str.dup(); | 2 | RubyString dup = (RubyString)str.dup(); | |||||||||||||
3 | if (dup.chomp_bang(context, arg0).isNil()) |
| 3 | if (dup.chomp_bang(args).isNil()) | ||||||||||||
4 | return str; | 4 | return str; | |||||||||||||
5 | context.getCurrentScope().setLastLine(dup); | 5 | context.getCurrentScope().setLastLine(dup); | |||||||||||||
6 | return dup; | 6 | return dup; |
Row | Violation |
---|---|
1 | Expression dup.chomp_bang(context,arg0) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression dup.chomp_bang(args) cannot be parameterized, because it has dependencies to/from statements that will be extracted |