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 compileTrue(Node, BodyCompiler, boolean)
|
Method name: void compileNil(Node, BodyCompiler, boolean)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | if (RubyInstanceConfig.PEEPHOLE_OPTZ) {↵ | 1 | if (RubyInstanceConfig.PEEPHOLE_OPTZ) {↵ | |
2 | if (expr) {↵ | 2 | if (expr) {↵ | |
3 | context.loadTrue();↵ | 3 | context.loadNil();↵ | |
4 | context.pollThreadEvents();↵ | 4 | context.pollThreadEvents();↵ | |
5 | }↵ | 5 | }↵ | |
6 | } else {↵ | 6 | } else {↵ | |
7 | context.loadTrue();↵ | 7 | context.loadNil();↵ | |
8 | context.pollThreadEvents();↵ | 8 | context.pollThreadEvents();↵ | |
9 | if (!expr) context.consumeCurrentValue();↵ | 9 | if (!expr) context.consumeCurrentValue();↵ | |
10 | } | 10 |
| |
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 | 29 |
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) | 2.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (RubyInstanceConfig.PEEPHOLE_OPTZ) | 1 | if (RubyInstanceConfig.PEEPHOLE_OPTZ) | |||||||||||||
2 | if (expr) | 2 | if (expr) | |||||||||||||
3 | context.loadTrue(); |
| 3 | context.loadNil(); | ||||||||||||
4 | context.pollThreadEvents(); | 4 | context.pollThreadEvents(); | |||||||||||||
else | else | |||||||||||||||
5 | context.loadTrue(); |
| 5 | context.loadNil(); | ||||||||||||
6 | context.pollThreadEvents(); | 6 | context.pollThreadEvents(); | |||||||||||||
7 | if (!expr) | 7 | if (!expr) | |||||||||||||
8 | context.consumeCurrentValue(); | 8 | context.consumeCurrentValue(); |
Row | Violation |
---|---|
1 | Expression context.loadTrue() is a void method call, and thus it cannot be parameterized |
2 | Expression context.loadNil() is a void method call, and thus it cannot be parameterized |
3 | Expression context.loadTrue() is a void method call, and thus it cannot be parameterized |
4 | Expression context.loadNil() is a void method call, and thus it cannot be parameterized |