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 zip(ThreadContext, IRubyObject[], Block)
|
Method name: IRubyObject zip(ThreadContext, IRubyObject[], Block)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | for (int i = 0; i < len; i++) {↵ | 1 | for (int i = 0; i < realLength; i++) {↵ | |
2 | RubyArray tmp = new RubyArray(runtime, args.length + 1);↵ | 2 | RubyArray tmp = new RubyArray(runtime, args.length + 1);↵ | |
3 | tmp.append(elt(i));↵ | 3 | tmp.append(elt(i));↵ | |
4 | for (int j = 0; j < args.length; j++) {↵ | 4 | for (int j = 0; j < args.length; j++) {↵ | |
5 | tmp.append(((RubyArray) args[j]).elt(i));↵ | 5 | tmp.append(((RubyArray) args[j]).elt(i));↵ | |
6 | }↵ | 6 | }↵ | |
7 | result.append(tmp);↵ | 7 | block.yield(context, tmp);↵ | |
8 | } | 8 | } | |
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.5 |
Clones location | Clones are in the same method |
Number of node comparisons | 25 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 3.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14 | for (int i = 0; i < len; i++) |
| 5 | for (int i = 0; i < realLength; i++) | ||||||||||
15 | RubyArray tmp = new RubyArray(runtime, args.length + 1); | 6 | RubyArray tmp = new RubyArray(runtime, args.length + 1); | |||||||||||
16 | tmp.append(elt(i)); | 7 | tmp.append(elt(i)); | |||||||||||
17 | for (int j = 0; j < args.length; j++) | 8 | for (int j = 0; j < args.length; j++) | |||||||||||
18 | tmp.append(((RubyArray)args[j]).elt(i)); | 9 | tmp.append(((RubyArray)args[j]).elt(i)); | |||||||||||
|
| 10 | block.yield(context, tmp); | |||||||||||
19 | result.append(tmp); |
| |
Row | Violation |
---|---|
1 | Unmatched statement block.yield(context,tmp); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement result.append(tmp); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |