File path: /jruby-1.4.0/src/org/jruby/RubyNumeric.java | File path: /jruby-1.4.0/src/org/jruby/RubyNumeric.java | |||
Method name: IRubyObject stepCommon19(ThreadContext, IRubyObject, IRubyObject, Block)
|
Method name: IRubyObject step(ThreadContext, IRubyObject, IRubyObject, Block)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | Ruby runtime = context.getRuntime();↵ | 1 | Ruby runtime = context.getRuntime();↵ | |
2 | if (this instanceof RubyFixnum && to instanceof RubyFixnum && step instanceof RubyFixnum) {↵ | 2 | if (this instanceof RubyFixnum && to instanceof RubyFixnum && step instanceof RubyFixnum) {↵ | |
3 | fixnumStep(context, runtime, ((RubyFixnum)this).getLongValue(),↵ | 3 | fixnumStep(context, runtime, ((RubyFixnum)this).getLongValue(),↵ | |
4 | ((RubyFixnum)to).getLongValue(),↵ | 4 | ((RubyFixnum)to).getLongValue(),↵ | |
5 | ((RubyFixnum)step).getLongValue(),↵ | 5 | ((RubyFixnum)step).getLongValue(),↵ | |
6 | block);↵ | 6 | block);↵ | |
7 | } else if (this instanceof RubyFloat || to instanceof RubyFloat || step instanceof RubyFloat) {↵ | 7 | } else if (this instanceof RubyFloat || to instanceof RubyFloat || step instanceof RubyFloat) {↵ | |
8 | floatStep19(context, runtime, this, to, step, false, block);↵ | 8 | floatStep(context, runtime, this, to, step, block);↵ | |
9 | } else {↵ | 9 | } else {↵ | |
10 | duckStep(context, runtime, this, to, step, block);↵ | 10 | duckStep(context, runtime, this, to, step, block);↵ | |
11 | }↵ | 11 | }↵ | |
12 | return this; | 12 |
| |
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.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 24 |
Number of mapped statements | 7 |
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) | 2.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Ruby runtime = context.getRuntime(); | 1 | Ruby runtime = context.getRuntime(); | ||||||||||||||||||||||
2 | if (this instanceof RubyFixnum && to instanceof RubyFixnum && step instanceof RubyFixnum) | 2 | if (this instanceof RubyFixnum && to instanceof RubyFixnum && step instanceof RubyFixnum) | ||||||||||||||||||||||
3 | fixnumStep(context, runtime, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), ((RubyFixnum)step).getLongValue(), block); | 3 | fixnumStep(context, runtime, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), ((RubyFixnum)step).getLongValue(), block); | ||||||||||||||||||||||
4 | else if (this instanceof RubyFloat || to instanceof RubyFloat || step instanceof RubyFloat) | 4 | else if (this instanceof RubyFloat || to instanceof RubyFloat || step instanceof RubyFloat) | ||||||||||||||||||||||
5 | floatStep19(context, runtime, this, to, step, false, block); |
| 5 | floatStep(context, runtime, this, to, step, block); | |||||||||||||||||||||
else | else | ||||||||||||||||||||||||
6 | duckStep(context, runtime, this, to, step, block); | 6 | duckStep(context, runtime, this, to, step, block); | ||||||||||||||||||||||
7 | return this; | 7 | return this; |
Row | Violation |
---|---|
1 | Expression floatStep19(context,runtime,this,to,step,false,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression floatStep(context,runtime,this,to,step,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression floatStep19(context,runtime,this,to,step,false,block) is a void method call, and thus it cannot be parameterized |
4 | Expression floatStep(context,runtime,this,to,step,block) is a void method call, and thus it cannot be parameterized |
5 | Expression floatStep19(context,runtime,this,to,step,false,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression floatStep(context,runtime,this,to,step,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression floatStep19(context,runtime,this,to,step,false,block) is a void method call, and thus it cannot be parameterized |
8 | Expression floatStep(context,runtime,this,to,step,block) is a void method call, and thus it cannot be parameterized |