File path: /jruby-1.4.0/src/org/jruby/RubyEnumerable.java | File path: /jruby-1.4.0/src/org/jruby/RubyEnumerable.java | |||
Method name: IRubyObject reject(ThreadContext, IRubyObject, Block)
|
Method name: IRubyObject select(ThreadContext, IRubyObject, Block)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | final Ruby runtime = context.getRuntime();↵ | 1 | final Ruby runtime = context.getRuntime();↵ | |
2 | final RubyArray result = runtime.newArray();↵ | 2 | final RubyArray result = runtime.newArray();↵ | |
3 | callEach(runtime, context, self, new BlockCallback() {↵ | 3 | callEach(runtime, context, self, new BlockCallback() {↵ | |
4 | public IRubyObject call(ThreadContext ctx, IRubyObject[] largs, Block blk) {↵ | 4 | public IRubyObject call(ThreadContext ctx, IRubyObject[] largs, Block blk) {↵ | |
5 | IRubyObject larg = checkArgs(runtime, largs);↵ | 5 | IRubyObject larg = checkArgs(runtime, largs);↵ | |
6 | if (!block.yield(ctx, larg).isTrue()) {↵ | 6 | if (block.yield(ctx, larg).isTrue()) {↵ | |
7 | synchronized (result) {↵ | 7 | synchronized (result) {↵ | |
8 | result.append(larg);↵ | 8 | result.append(larg);↵ | |
9 | }↵ | 9 | }↵ | |
10 | }↵ | 10 | }↵ | |
11 | return runtime.getNil();↵ | 11 | return runtime.getNil();↵ | |
12 | }↵ | 12 | }↵ | |
13 | });↵ | 13 | });↵ | |
14 | return result; | 14 |
| |
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
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) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | final Ruby runtime = context.getRuntime(); | 1 | final Ruby runtime = context.getRuntime(); | |||||||||||||
2 | final RubyArray result = runtime.newArray(); | 2 | final RubyArray result = runtime.newArray(); | |||||||||||||
3 | callEach(runtime, context, self, new BlockCallback() {...}); |
| 3 | callEach(runtime, context, self, new BlockCallback() {...}); | ||||||||||||
4 | return result; | 4 | return result; |
Row | Violation |
---|---|
1 | Expression !block.yield(ctx,larg).isTrue() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression block.yield(ctx,larg).isTrue() cannot be parameterized, because it has dependencies to/from statements that will be extracted |