File path: /jruby-1.4.0/src/org/jruby/RubyString.java | File path: /jruby-1.4.0/src/org/jruby/RubyString.java | |||
Method name: RubyArray split(ThreadContext, IRubyObject, IRubyObject)
|
Method name: RubyArray split19(ThreadContext, IRubyObject, IRubyObject)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | final int lim = RubyNumeric.num2int(arg1);↵ | 1 | final int lim = RubyNumeric.num2int(arg1);↵ | |
2 | if (lim <= 0) {↵ | 2 | if (lim <= 0) {↵ | |
3 | return splitCommon(arg0, false, lim, 1, context);↵ | 3 | return splitCommon19(arg0, false, lim, 1, context);↵ | |
4 | } else {↵ | 4 | } else {↵ | |
5 | if (lim == 1) return value.realSize == 0 ? context.getRuntime().newArray() : context.getRuntime().newArray(this);↵ | 5 | if (lim == 1) return value.realSize == 0 ? context.getRuntime().newArray() : context.getRuntime().newArray(this);↵ | |
6 | return splitCommon(arg0, true, lim, 1, context);↵ | 6 | return splitCommon19(arg0, true, lim, 1, context);↵ | |
7 | } | 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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 14 |
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) | 3.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | final int lim = RubyNumeric.num2int(arg1); | 1 | final int lim = RubyNumeric.num2int(arg1); | |||||||||||||
2 | if (lim <= 0) | 2 | if (lim <= 0) | |||||||||||||
3 | return splitCommon(arg0, false, lim, 1, context); |
| 3 | return splitCommon19(arg0, false, lim, 1, context); | ||||||||||||
else | else | |||||||||||||||
4 | if (lim == 1) | 4 | if (lim == 1) | |||||||||||||
5 | return value.realSize == 0 ? context.getRuntime().newArray() : context.getRuntime().newArray(this); | 5 | return value.realSize == 0 ? context.getRuntime().newArray() : context.getRuntime().newArray(this); | |||||||||||||
6 | return splitCommon(arg0, true, lim, 1, context); |
| 6 | return splitCommon19(arg0, true, lim, 1, context); |
Row | Violation |
---|---|
1 | Expression splitCommon(arg0,false,lim,1,context) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression splitCommon19(arg0,false,lim,1,context) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression splitCommon(arg0,true,lim,1,context) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression splitCommon19(arg0,true,lim,1,context) cannot be parameterized, because it has dependencies to/from statements that will be extracted |