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 compileAnd(Node, BodyCompiler, boolean)
|
Method name: void compileOr(Node, BodyCompiler, boolean)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | compile(andNode.getFirstNode(), context, true);↵ | 1 | compile(orNode.getFirstNode(), context, true);↵ | |
2 | BranchCallback longCallback = new BranchCallback() {↵ | 2 | BranchCallback longCallback = new BranchCallback() {↵ | |
3 | public void branch(BodyCompiler context) {↵ | 3 | public void branch(BodyCompiler context) {↵ | |
4 | compile(andNode.getSecondNode(), context, true);↵ | 4 | compile(orNode.getSecondNode(), context, true);↵ | |
5 | }↵ | 5 | }↵ | |
6 | };↵ | 6 | };↵ | |
7 | context.performLogicalAnd(longCallback);↵ | 7 | context.performLogicalOr(longCallback);↵ | |
8 | // TODO: don't require pop↵ | |||
8 | if (!expr) context.consumeCurrentValue(); | 9 |
| |
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.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 12 |
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) | 9.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | compile(andNode.getFirstNode(), context, true); |
| 7 | compile(orNode.getFirstNode(), context, true); | ||||||||||||||
8 | BranchCallback longCallback = new BranchCallback() {...}; |
| 8 | BranchCallback longCallback = new BranchCallback() {...}; | ||||||||||||||
9 | context.performLogicalAnd(longCallback); |
| 9 | context.performLogicalOr(longCallback); | ||||||||||||||
10 | if (!expr) | 10 | if (!expr) | |||||||||||||||
11 | context.consumeCurrentValue(); | 11 | context.consumeCurrentValue(); |
Row | Violation |
---|---|
1 | Expression andNode cannot be unified with expression orNode , because common superclass org.jruby.ast.Node does not declare member(s) public org.jruby.ast.Node getFirstNode() |
2 | Expression andNode cannot be unified with expression orNode , because common superclass org.jruby.ast.Node does not declare member(s) public org.jruby.ast.Node getSecondNode() |
3 | Expression context.performLogicalAnd(longCallback) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression context.performLogicalOr(longCallback) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression context.performLogicalAnd(longCallback) is a void method call, and thus it cannot be parameterized |
6 | Expression context.performLogicalOr(longCallback) is a void method call, and thus it cannot be parameterized |