File path: /jruby-1.4.0/src/org/jruby/RubyIO.java | File path: /jruby-1.4.0/src/org/jruby/RubyIO.java | |||
Method name: ModeFlags parseOptions(ThreadContext, IRubyObject, ModeFlags)
|
Method name: ModeFlags parseOptions(ThreadContext, IRubyObject, ModeFlags)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | if (externalEncodingOption != null && !externalEncodingOption.isNil()) {↵ | 1 | if (internalEncodingOption != null && !internalEncodingOption.isNil()) {↵ | |
2 | if (dash.eql(externalEncodingOption)) {↵ | 2 | if (dash.eql(internalEncodingOption)) {↵ | |
3 | externalEncodingOption = RubyEncoding.getDefaultExternal(runtime);↵ | 3 | internalEncodingOption = RubyEncoding.getDefaultInternal(runtime);↵ | |
4 | }↵ | 4 | }↵ | |
5 | setExternalEncoding(context, externalEncodingOption);↵ | 5 | setInternalEncoding(context, internalEncodingOption);↵ | |
6 | } | 6 |
| |
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 in the same method |
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) | 1.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6 | if (externalEncodingOption != null && !externalEncodingOption.isNil()) |
| 10 | if (internalEncodingOption != null && !internalEncodingOption.isNil()) | |||||||||||||||||
7 | if (dash.eql(externalEncodingOption)) |
| 11 | if (dash.eql(internalEncodingOption)) | |||||||||||||||||
8 | externalEncodingOption = RubyEncoding.getDefaultExternal(runtime); |
| 12 | internalEncodingOption = RubyEncoding.getDefaultInternal(runtime); | |||||||||||||||||
9 | setExternalEncoding(context, externalEncodingOption); |
| 13 | setInternalEncoding(context, internalEncodingOption); |
Row | Violation |
---|---|
1 | Expression setExternalEncoding(context,externalEncodingOption) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression setInternalEncoding(context,internalEncodingOption) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression setExternalEncoding(context,externalEncodingOption) is a void method call, and thus it cannot be parameterized |
4 | Expression setInternalEncoding(context,internalEncodingOption) is a void method call, and thus it cannot be parameterized |