File path: /jruby-1.4.0/src/org/jruby/ast/executable/AbstractScript.java | File path: /jruby-1.4.0/src/org/jruby/ast/executable/AbstractScript.java | |||
Method name: BlockBody createBlockBody19(Object, ThreadContext, int, String)
|
Method name: BlockBody createBlockBody(Object, ThreadContext, int, String)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | String[] firstSplit = descriptor.split(",");↵ | 1 | String[] firstSplit = descriptor.split(",");↵ | |
2 | String[] secondSplit;↵ | 2 | String[] secondSplit;↵ | |
3 | if (firstSplit[2].length() == 0) {↵ | 3 | if (firstSplit[2].length() == 0) {↵ | |
4 | secondSplit = new String[0];↵ | 4 | secondSplit = new String[0];↵ | |
5 | } else {↵ | 5 | } else {↵ | |
6 | secondSplit = firstSplit[2].split(";");↵ | 6 | secondSplit = firstSplit[2].split(";");↵ | |
7 | // FIXME: Big fat hack here, because scope names are expected to be interned strings by the parser↵ | 7 | // FIXME: Big fat hack here, because scope names are expected to be interned strings by the parser↵ | |
8 | for (int i = 0; i < secondSplit.length; i++) {↵ | 8 | for (int i = 0; i < secondSplit.length; i++) {↵ | |
9 | secondSplit[i] = secondSplit[i].intern();↵ | 9 | secondSplit[i] = secondSplit[i].intern();↵ | |
10 | }↵ | 10 | }↵ | |
11 | }↵ | 11 | }↵ | |
12 | BlockBody body = RuntimeHelpers.createCompiledBlockBody19(↵ | 12 | BlockBody body = RuntimeHelpers.createCompiledBlockBody(↵ | |
13 | context,↵ | 13 | context,↵ | |
14 | scriptObject,↵ | 14 | scriptObject,↵ | |
15 | firstSplit[0],↵ | 15 | firstSplit[0],↵ | |
16 | Integer.parseInt(firstSplit[1]),↵ | 16 | Integer.parseInt(firstSplit[1]),↵ | |
17 | secondSplit,↵ | 17 | secondSplit,↵ | |
18 | Boolean.valueOf(firstSplit[3]),↵ | 18 | Boolean.valueOf(firstSplit[3]),↵ | |
19 | Integer.parseInt(firstSplit[4]),↵ | 19 | Integer.parseInt(firstSplit[4]),↵ | |
20 | Boolean.valueOf(firstSplit[5]));↵ | 20 | Boolean.valueOf(firstSplit[5]));↵ | |
21 | return blockBodies[index] = body; | 21 |
| |
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 23 |
Number of mapped statements | 9 |
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) | 3.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String[] firstSplit = descriptor.split(","); | 1 | String[] firstSplit = descriptor.split(","); | |||||||||||||
2 | String[] secondSplit; | 2 | String[] secondSplit; | |||||||||||||
3 | if (firstSplit[2].length() == 0) | 3 | if (firstSplit[2].length() == 0) | |||||||||||||
4 | secondSplit = new String[0]; | 4 | secondSplit = new String[0]; | |||||||||||||
else | else | |||||||||||||||
5 | secondSplit = firstSplit[2].split(";"); | 5 | secondSplit = firstSplit[2].split(";"); | |||||||||||||
6 | for (int i = 0; i < secondSplit.length; i++) | 6 | for (int i = 0; i < secondSplit.length; i++) | |||||||||||||
7 | secondSplit[i] = secondSplit[i].intern(); | 7 | secondSplit[i] = secondSplit[i].intern(); | |||||||||||||
8 | BlockBody body = RuntimeHelpers.createCompiledBlockBody19(context, scriptObject, firstSplit[0], Integer.parseInt(firstSplit[1]), secondSplit, Boolean.valueOf(firstSplit[3]), Integer.parseInt(firstSplit[4]), Boolean.valueOf(firstSplit[5])); |
| 8 | BlockBody body = RuntimeHelpers.createCompiledBlockBody(context, scriptObject, firstSplit[0], Integer.parseInt(firstSplit[1]), secondSplit, Boolean.valueOf(firstSplit[3]), Integer.parseInt(firstSplit[4]), Boolean.valueOf(firstSplit[5])); | ||||||||||||
9 | return blockBodies[index] = body; | 9 | return blockBodies[index] = body; |
Row | Violation |
---|---|
1 | Expression RuntimeHelpers.createCompiledBlockBody19(context,scriptObject,firstSplit[0],Integer.parseInt(firstSplit[1]),secondSplit,Boolean.valueOf(firstSplit[3]),Integer.parseInt(firstSplit[4]),Boolean.valueOf(firstSplit[5])) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression RuntimeHelpers.createCompiledBlockBody(context,scriptObject,firstSplit[0],Integer.parseInt(firstSplit[1]),secondSplit,Boolean.valueOf(firstSplit[3]),Integer.parseInt(firstSplit[4]),Boolean.valueOf(firstSplit[5])) cannot be parameterized, because it has dependencies to/from statements that will be extracted |