File path: /jruby-1.4.0/src/org/jruby/runtime/scope/FourVarDynamicScope.java | File path: /jruby-1.4.0/src/org/jruby/runtime/scope/TwoVarDynamicScope.java | |||
Method name: IRubyObject setValue(int, IRubyObject, int)
|
Method name: IRubyObject setValue(int, IRubyObject, int)
|
|||
Number of AST nodes: 15 | Number of AST nodes: 11 | |||
1 | if (depth > 0) {↵ | 1 | if (depth > 0) {↵ | |
2 | assert parent != null : "If depth > 0, then parent should not ever be null";↵ | 2 | assert parent != null : "If depth > 0, then parent should not ever be null";↵ | |
3 | ↵ | 3 | ↵ | |
4 | return parent.setValue(offset, value, depth - 1);↵ | 4 | return parent.setValue(offset, value, depth - 1);↵ | |
5 | } else {↵ | 5 | } else {↵ | |
6 | assert offset < SIZE : SIZE_ERROR;↵ | 6 | assert offset < SIZE : SIZE_ERROR;↵ | |
7 | switch (offset) {↵ | 7 | switch (offset) {↵ | |
8 | case 0:↵ | 8 | case 0:↵ | |
9 | return variableValueZero = value;↵ | 9 | return variableValueZero = value;↵ | |
10 | case 1:↵ | 10 | case 1:↵ | |
11 | return variableValueOne = value;↵ | 11 | return variableValueOne = value;↵ | |
12 | case 2:↵ | |||
13 | return variableValueTwo = value;↵ | |||
14 | case 3:↵ | |||
15 | return variableValueThree = value;↵ | |||
16 | default:↵ | 12 | default:↵ | |
17 | throw new RuntimeException(SIZE_ERROR);↵ | 13 | throw new RuntimeException(SIZE_ERROR);↵ | |
18 | }↵ | 14 | }↵ | |
19 | } | 15 |
| |
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 in different classes having the same super class |
Number of node comparisons | 49 |
Number of mapped statements | 11 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
1 | if (depth > 0) | 1 | if (depth > 0) | ||||
2 | assert parent != null : "If depth > 0, then parent should not ever be null"; | 2 | assert parent != null : "If depth > 0, then parent should not ever be null"; | ||||
3 | return parent.setValue(offset, value, depth - 1); | 3 | return parent.setValue(offset, value, depth - 1); | ||||
else | else | ||||||
4 | assert offset < SIZE : SIZE_ERROR; | 4 | assert offset < SIZE : SIZE_ERROR; | ||||
5 | switch (offset) | 5 | switch (offset) | ||||
6 | case 0: | 6 | case 0: | ||||
7 | return variableValueZero = value; | 7 | return variableValueZero = value; | ||||
8 | case 1: | 8 | case 1: | ||||
9 | return variableValueOne = value; | 9 | return variableValueOne = value; | ||||
10 | case 2: | | |||||
11 | return variableValueTwo = value; |
| | ||||
12 | case 3: | | |||||
13 | return variableValueThree = value; |
| | ||||
14 | default: | 10 | default: | ||||
15 | throw new RuntimeException(SIZE_ERROR); | 11 | throw new RuntimeException(SIZE_ERROR); |
Row | Violation |
---|---|
1 | Unmatched return variableValueTwo=value; |
2 | Unmatched return variableValueThree=value; |