File path: /jruby-1.4.0/src/org/jruby/compiler/impl/ChainedChildBodyCompiler19.java | File path: /jruby-1.4.0/src/org/jruby/compiler/impl/ChildScopedBodyCompiler.java | |||
Method name: ChainedChildBodyCompiler outline(String)
|
Method name: ChainedChildBodyCompiler outline(String)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | method.aload(StandardASMCompiler.THIS);↵ | 1 | method.aload(StandardASMCompiler.THIS);↵ | |
2 | // load all arguments straight through↵ | 2 | // load all arguments straight through↵ | |
3 | for (int i = 1; i <= 4; i++) {↵ | 3 | for (int i = 1; i <= 3; i++) {↵ | |
4 | method.aload(i);↵ | 4 | method.aload(i);↵ | |
5 | }↵ | 5 | }↵ | |
6 | // we append an index to ensure two identical method names will not conflict↵ | 6 | // we append an index to ensure two identical method names will not conflict↵ | |
7 | methodName = methodName + "_" + script.getAndIncrementMethodIndex();↵ | 7 | methodName = methodName + "_" + script.getAndIncrementMethodIndex();↵ | |
8 | method.invokestatic(script.getClassname(), methodName, getSignature());↵ | 8 | method.invokestatic(script.getClassname(), methodName, getSignature());↵ | |
9 | ChainedChildBodyCompiler19 methodCompiler = new ChainedChildBodyCompiler19(script, methodName, inspector, scope, this);↵ | 9 | ChainedChildBodyCompiler methodCompiler = new ChainedChildBodyCompiler(script, methodName, inspector, scope, this);↵ | |
10 | methodCompiler.beginChainedMethod();↵ | 10 | methodCompiler.beginChainedMethod();↵ | |
11 | return methodCompiler; | 11 |
| |
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 30 |
Number of mapped statements | 8 |
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.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | method.aload(StandardASMCompiler.THIS); | 1 | method.aload(StandardASMCompiler.THIS); | |||||||||||||||||||
2 | for (int i = 1; i <= 4; i++) |
| 2 | for (int i = 1; i <= 3; i++) | ||||||||||||||||||
3 | method.aload(i); | 3 | method.aload(i); | |||||||||||||||||||
4 | methodName = methodName + "_" + script.getAndIncrementMethodIndex(); | 4 | methodName = methodName + "_" + script.getAndIncrementMethodIndex(); | |||||||||||||||||||
5 | method.invokestatic(script.getClassname(), methodName, getSignature()); | 5 | method.invokestatic(script.getClassname(), methodName, getSignature()); | |||||||||||||||||||
6 | ChainedChildBodyCompiler19 methodCompiler = new ChainedChildBodyCompiler19(script, methodName, inspector, scope, this); |
| 6 | ChainedChildBodyCompiler methodCompiler = new ChainedChildBodyCompiler(script, methodName, inspector, scope, this); | ||||||||||||||||||
7 | methodCompiler.beginChainedMethod(); |
| 7 | methodCompiler.beginChainedMethod(); | ||||||||||||||||||
8 | return methodCompiler; |
| 8 | return methodCompiler; |
Row | Violation |
---|---|
1 | Expression new ChainedChildBodyCompiler19(script,methodName,inspector,scope,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new ChainedChildBodyCompiler(script,methodName,inspector,scope,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted |