File path: /jruby-1.4.0/src/org/jruby/util/Numeric.java | File path: /jruby-1.4.0/src/org/jruby/util/Numeric.java | |||
Method name: IRubyObject f_mul(ThreadContext, IRubyObject, IRubyObject)
|
Method name: IRubyObject f_mul(ThreadContext, IRubyObject, IRubyObject)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 6 | |||
1 | if (x instanceof RubyFixnum) {↵ | |||
2 | long ix = ((RubyFixnum)x).getLongValue();↵ | 1 | long iy = ((RubyFixnum)y).getLongValue();↵ | |
3 | if (ix == 0) {↵ | 2 | if (iy == 0) {↵ | |
4 | if (y instanceof RubyFixnum || y instanceof RubyBignum) return RubyFixnum.zero(runtime);↵ | 3 | if (x instanceof RubyFixnum || x instanceof RubyBignum) return RubyFixnum.zero(runtime);↵ | |
5 | } else if (ix == 1) {↵ | 4 | } else if (iy == 1) {↵ | |
6 | return y;↵ | 5 | return x;↵ | |
7 | }↵ | 6 |
| |
8 | } | |||
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 11 |
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.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10 | long ix = ((RubyFixnum)x).getLongValue(); |
| 3 | long iy = ((RubyFixnum)y).getLongValue(); | |||||||||||||
11 | if (ix == 0) |
| 4 | if (iy == 0) | |||||||||||||
12 | if (y instanceof RubyFixnum || y instanceof RubyBignum) |
| 5 | if (x instanceof RubyFixnum || x instanceof RubyBignum) | |||||||||||||
13 | return RubyFixnum.zero(runtime); | 6 | return RubyFixnum.zero(runtime); | ||||||||||||||
14 | else if (ix == 1) |
| 7 | else if (iy == 1) | |||||||||||||
15 | return y; |
| 8 | return x; |
Row | Violation |
---|