File path: /jruby-1.4.0/src/org/jruby/RubyInteger.java | File path: /jruby-1.4.0/src/org/jruby/RubyInteger.java | |||
Method name: IRubyObject downto(ThreadContext, IRubyObject, Block)
|
Method name: IRubyObject upto(ThreadContext, IRubyObject, Block)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | if (this instanceof RubyFixnum && to instanceof RubyFixnum) {↵ | 1 | if (this instanceof RubyFixnum && to instanceof RubyFixnum) {↵ | |
2 | fixnumDownto(context, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), block);↵ | 2 | fixnumUpto(context, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), block);↵ | |
3 | } else {↵ | 3 | } else {↵ | |
4 | duckDownto(context, this, to, block);↵ | 4 | duckUpto(context, this, to, block);↵ | |
5 | }↵ | 5 | }↵ | |
6 | return this; | 6 |
| |
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 | 10 |
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) | 1.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (this instanceof RubyFixnum && to instanceof RubyFixnum) | 1 | if (this instanceof RubyFixnum && to instanceof RubyFixnum) | |||||||||||||||
2 | fixnumDownto(context, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), block); |
| 2 | fixnumUpto(context, ((RubyFixnum)this).getLongValue(), ((RubyFixnum)to).getLongValue(), block); | ||||||||||||||
else | else | |||||||||||||||||
3 | duckDownto(context, this, to, block); |
| 3 | duckUpto(context, this, to, block); | ||||||||||||||
4 | return this; | 4 | return this; |
Row | Violation |
---|---|
1 | Expression fixnumDownto(context,((RubyFixnum)this).getLongValue(),((RubyFixnum)to).getLongValue(),block) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression fixnumUpto(context,((RubyFixnum)this).getLongValue(),((RubyFixnum)to).getLongValue(),block) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression fixnumDownto(context,((RubyFixnum)this).getLongValue(),((RubyFixnum)to).getLongValue(),block) is a void method call, and thus it cannot be parameterized |
4 | Expression fixnumUpto(context,((RubyFixnum)this).getLongValue(),((RubyFixnum)to).getLongValue(),block) is a void method call, and thus it cannot be parameterized |
5 | Expression duckDownto(context,this,to,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression duckUpto(context,this,to,block) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression duckDownto(context,this,to,block) is a void method call, and thus it cannot be parameterized |
8 | Expression duckUpto(context,this,to,block) is a void method call, and thus it cannot be parameterized |