File path: /jruby-1.4.0/src/org/jruby/RubyArgsFile.java | File path: /jruby-1.4.0/src/org/jruby/RubyArgsFile.java | |||
Method name: IRubyObject to_a(ThreadContext, IRubyObject, IRubyObject[])
|
Method name: IRubyObject readlines(ThreadContext, IRubyObject, IRubyObject[])
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | ArgsFileData data = ArgsFileData.getDataFrom(recv);↵ | 1 | ArgsFileData data = ArgsFileData.getDataFrom(recv);↵ | |
2 | Ruby runtime = context.getRuntime();↵ | 2 | Ruby runtime = context.getRuntime();↵ | |
3 | ↵ | 3 | ↵ | |
4 | if (!data.next_argv(context)) {↵ | 4 | if (!data.next_argv(context)) {↵ | |
5 | return runtime.is1_9() ? runtime.newEmptyArray() : runtime.getNil();↵ | 5 | return runtime.is1_9() ? runtime.newEmptyArray() : runtime.getNil();↵ | |
6 | }↵ | 6 | }↵ | |
7 | if (!(data.currentFile instanceof RubyIO)) {↵ | 7 | if (!(data.currentFile instanceof RubyIO)) {↵ | |
8 | return data.currentFile.callMethod(context, "to_a", args);↵ | 8 | return data.currentFile.callMethod(context, "readlines", args);↵ | |
9 | }↵ | 9 | }↵ | |
10 | ↵ | 10 | ↵ | |
11 | RubyArray ary = runtime.newArray();↵ | 11 | RubyArray ary = runtime.newArray();↵ | |
12 | IRubyObject line;↵ | 12 | IRubyObject line;↵ | |
13 | while(!(line = argf_getline(context, recv, args)).isNil()) {↵ | 13 | while(!(line = argf_getline(context, recv, args)).isNil()) {↵ | |
14 | ary.append(line);↵ | 14 | ary.append(line);↵ | |
15 | }↵ | 15 | }↵ | |
16 | return ary; | 16 |
| |
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.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 52 |
Number of mapped statements | 11 |
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) | 4.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | ArgsFileData data = ArgsFileData.getDataFrom(recv); | 1 | ArgsFileData data = ArgsFileData.getDataFrom(recv); | |||||||||||
2 | Ruby runtime = context.getRuntime(); | 2 | Ruby runtime = context.getRuntime(); | |||||||||||
3 | if (!data.next_argv(context)) | 3 | if (!data.next_argv(context)) | |||||||||||
4 | return runtime.is1_9() ? runtime.newEmptyArray() : runtime.getNil(); | 4 | return runtime.is1_9() ? runtime.newEmptyArray() : runtime.getNil(); | |||||||||||
5 | if (!(data.currentFile instanceof RubyIO)) | 5 | if (!(data.currentFile instanceof RubyIO)) | |||||||||||
6 | return data.currentFile.callMethod(context, "to_a", args); |
| 6 | return data.currentFile.callMethod(context, "readlines", args); | ||||||||||
7 | RubyArray ary = runtime.newArray(); | 7 | RubyArray ary = runtime.newArray(); | |||||||||||
8 | IRubyObject line; | 8 | IRubyObject line; | |||||||||||
9 | while (!(line = argf_getline(context, recv, args)).isNil()) | 9 | while (!(line = argf_getline(context, recv, args)).isNil()) | |||||||||||
10 | ary.append(line); | 10 | ary.append(line); | |||||||||||
11 | return ary; | 11 | return ary; |
Row | Violation |
---|