File path: /jruby-1.4.0/src/org/jruby/runtime/scope/ManyVarsDynamicScope.java | File path: /jruby-1.4.0/src/org/jruby/runtime/scope/ManyVarsDynamicScope.java | |||
Method name: IRubyObject getValueOneDepthZeroOrNil(IRubyObject)
|
Method name: IRubyObject getValueTwoDepthZeroOrNil(IRubyObject)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | assertGetValueOneDepthZeroOrNil();↵ | 1 | assertGetValueTwoDepthZeroOrNil();↵ | |
2 | // &foo are not getting set from somewhere...I want the following assert to be true though↵ | 2 | // &foo are not getting set from somewhere...I want the following assert to be true though↵ | |
3 | //assert variableValues[offset] != null : "Getting unassigned: " + staticScope.getVariables()[offset];↵ | 3 | //assert variableValues[offset] != null : "Getting unassigned: " + staticScope.getVariables()[offset];↵ | |
4 | IRubyObject value = variableValues[1];↵ | 4 | IRubyObject value = variableValues[2];↵ | |
5 | if (value == null) {↵ | 5 | if (value == null) {↵ | |
6 | return setValueOneDepthZero(value);↵ | 6 | return setValueTwoDepthZero(value);↵ | |
7 | }↵ | 7 | }↵ | |
8 | return value; | 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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 13 |
Number of mapped statements | 5 |
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.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | assertGetValueOneDepthZeroOrNil(); |
| 1 | assertGetValueTwoDepthZeroOrNil(); | ||||||||||||
2 | IRubyObject value = variableValues[1]; |
| 2 | IRubyObject value = variableValues[2]; | ||||||||||||
3 | if (value == null) | 3 | if (value == null) | |||||||||||||
4 | return setValueOneDepthZero(value); |
| 4 | return setValueTwoDepthZero(value); | ||||||||||||
5 | return value; | 5 | return value; |
Row | Violation |
---|---|
1 | Expression assertGetValueOneDepthZeroOrNil() is a void method call, and thus it cannot be parameterized |
2 | Expression assertGetValueTwoDepthZeroOrNil() is a void method call, and thus it cannot be parameterized |
3 | Expression setValueOneDepthZero(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression setValueTwoDepthZero(value) cannot be parameterized, because it has dependencies to/from statements that will be extracted |