File path: /jruby-1.4.0/src/org/jruby/RubyArray.java | File path: /jruby-1.4.0/src/org/jruby/RubyArray.java | |||
Method name: IRubyObject rindex(ThreadContext, IRubyObject)
|
Method name: IRubyObject rindex(ThreadContext, Block)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | while (i-- > 0) {↵ | 1 | while (i-- > 0) {↵ | |
2 | if (i > realLength) {↵ | 2 | if (i > realLength) {↵ | |
3 | i = realLength;↵ | 3 | i = realLength;↵ | |
4 | continue;↵ | 4 | continue;↵ | |
5 | }↵ | 5 | }↵ | |
6 | if (equalInternal(context, values[begin + i], obj)) return runtime.newFixnum(i);↵ | 6 | if (block.yield(context, values[begin + i]).isTrue()) return runtime.newFixnum(i);↵ | |
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 | 21 |
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.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | while (i-- > 0) | 5 | while (i-- > 0) | |||||||||||||||||||||
4 | if (i > realLength) | 6 | if (i > realLength) | |||||||||||||||||||||
5 | i = realLength; | 7 | i = realLength; | |||||||||||||||||||||
6 | continue; | 8 | continue; | |||||||||||||||||||||
7 | if (equalInternal(context, values[begin + i], obj)) |
| 9 | if (block.yield(context, values[begin + i]).isTrue()) | ||||||||||||||||||||
8 | return runtime.newFixnum(i); | 10 | return runtime.newFixnum(i); |
Row | Violation |
---|---|
1 | Expression equalInternal(context,values[begin + i],obj) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression block.yield(context,values[begin + i]).isTrue() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression equalInternal(context,values[begin + i],obj) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression block.yield(context,values[begin + i]).isTrue() cannot be parameterized, because it has dependencies to/from statements that will be extracted |