File path: /jruby-1.4.0/src/org/jruby/compiler/ASTCompiler.java | File path: /jruby-1.4.0/src/org/jruby/compiler/ASTCompiler.java | |||
Method name: void compileOpAsgnWithAnd(Node, BodyCompiler, boolean)
|
Method name: void compileOpAsgnWithOr(Node, BodyCompiler, boolean)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | final OpAsgnNode opAsgnNode = (OpAsgnNode) node;↵ | 1 | final OpAsgnNode opAsgnNode = (OpAsgnNode) node;↵ | |
2 | final CompilerCallback receiverCallback = new CompilerCallback() {↵ | 2 | final CompilerCallback receiverCallback = new CompilerCallback() {↵ | |
3 | public void call(BodyCompiler context) {↵ | 3 | public void call(BodyCompiler context) {↵ | |
4 | compile(opAsgnNode.getReceiverNode(), context, true); // [recv]↵ | 4 | compile(opAsgnNode.getReceiverNode(), context, true); // [recv]↵ | |
5 | }↵ | 5 | }↵ | |
6 | };↵ | 6 | };↵ | |
7 | ↵ | 7 | ↵ | |
8 | ArgumentsCallback argsCallback = getArgsCallback(opAsgnNode.getValueNode());↵ | 8 | ArgumentsCallback argsCallback = getArgsCallback(opAsgnNode.getValueNode());↵ | |
9 | ↵ | 9 | ↵ | |
10 | context.getInvocationCompiler().invokeOpAsgnWithAnd(opAsgnNode.getVariableName(), opAsgnNode.getVariableNameAsgn(), receiverCallback, argsCallback);↵ | 10 | context.getInvocationCompiler().invokeOpAsgnWithOr(opAsgnNode.getVariableName(), opAsgnNode.getVariableNameAsgn(), receiverCallback, argsCallback);↵ | |
11 | // TODO: don't require pop↵ | 11 | // TODO: don't require pop↵ | |
12 | if (!expr) context.consumeCurrentValue(); | 12 |
| |
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 | 14 |
Number of mapped statements | 6 |
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) | 7.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | final OpAsgnNode opAsgnNode = (OpAsgnNode)node; | 1 | final OpAsgnNode opAsgnNode = (OpAsgnNode)node; | |||||||||||||||
2 | final CompilerCallback receiverCallback = new CompilerCallback() {...}; | 2 | final CompilerCallback receiverCallback = new CompilerCallback() {...}; | |||||||||||||||
3 | ArgumentsCallback argsCallback = getArgsCallback(opAsgnNode.getValueNode()); | 3 | ArgumentsCallback argsCallback = getArgsCallback(opAsgnNode.getValueNode()); | |||||||||||||||
4 | context.getInvocationCompiler().invokeOpAsgnWithAnd(opAsgnNode.getVariableName(), opAsgnNode.getVariableNameAsgn(), receiverCallback, argsCallback); |
| 4 | context.getInvocationCompiler().invokeOpAsgnWithOr(opAsgnNode.getVariableName(), opAsgnNode.getVariableNameAsgn(), receiverCallback, argsCallback); | ||||||||||||||
5 | if (!expr) | 5 | if (!expr) | |||||||||||||||
6 | context.consumeCurrentValue(); | 6 | context.consumeCurrentValue(); |
Row | Violation |
---|---|
1 | Expression context.getInvocationCompiler().invokeOpAsgnWithAnd(opAsgnNode.getVariableName(),opAsgnNode.getVariableNameAsgn(),receiverCallback,argsCallback) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression context.getInvocationCompiler().invokeOpAsgnWithOr(opAsgnNode.getVariableName(),opAsgnNode.getVariableNameAsgn(),receiverCallback,argsCallback) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression context.getInvocationCompiler().invokeOpAsgnWithAnd(opAsgnNode.getVariableName(),opAsgnNode.getVariableNameAsgn(),receiverCallback,argsCallback) is a void method call, and thus it cannot be parameterized |
4 | Expression context.getInvocationCompiler().invokeOpAsgnWithOr(opAsgnNode.getVariableName(),opAsgnNode.getVariableNameAsgn(),receiverCallback,argsCallback) is a void method call, and thus it cannot be parameterized |