File path: /jruby-1.4.0/src/org/jruby/RubyNumeric.java | File path: /jruby-1.4.0/src/org/jruby/ext/socket/RubyBasicSocket.java | |||
Method name: long num2long(IRubyObject)
|
Method name: int asNumber(IRubyObject)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | if (arg instanceof RubyFixnum) {↵ | 1 | if(val instanceof RubyNumeric) {↵ | |
2 | return ((RubyFixnum) arg).getLongValue();↵ | 2 | return RubyNumeric.fix2int(val);↵ | |
3 | } else {↵ | 3 | } else {↵ | |
4 | return other2long(arg);↵ | 4 | return stringAsNumber(val);↵ | |
5 | } | 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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 9 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (arg instanceof RubyFixnum) |
| 1 | if (val instanceof RubyNumeric) | |||||||||||||
|
| 2 | return RubyNumeric.fix2int(val); | ||||||||||||||
2 | return ((RubyFixnum)arg).getLongValue(); |
| | ||||||||||||||
else | | ||||||||||||||||
|
| 3 | return stringAsNumber(val); | ||||||||||||||
3 | return other2long(arg); |
| |
Row | Violation |
---|---|
1 | Unmatched return RubyNumeric.fix2int(val); |
2 | Unmatched return ((RubyFixnum)arg).getLongValue(); |
3 | Unmatched return stringAsNumber(val); |
4 | Unmatched return other2long(arg); |