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 compileAlias(Node, BodyCompiler, boolean)
|
Method name: void compileVAlias(Node, BodyCompiler, boolean)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | final AliasNode alias = (AliasNode) node;↵ | 1 | VAliasNode valiasNode = (VAliasNode) node;↵ | |
2 | context.defineAlias(alias.getNewName(), alias.getOldName());↵ | 2 | context.aliasGlobal(valiasNode.getNewName(), valiasNode.getOldName());↵ | |
3 | // TODO: don't require pop↵ | 3 | // TODO: don't require pop↵ | |
4 | if (!expr) context.consumeCurrentValue(); | 4 |
| |
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 | 8 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 4.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | VAliasNode valiasNode = (VAliasNode)node; | ||||||||||||||||||||||||||||
1 | final AliasNode alias = (AliasNode)node; | | ||||||||||||||||||||||||||||
2 | context.defineAlias(alias.getNewName(), alias.getOldName()); |
| 2 | context.aliasGlobal(valiasNode.getNewName(), valiasNode.getOldName()); | ||||||||||||||||||||||||||
3 | if (!expr) | 3 | if (!expr) | |||||||||||||||||||||||||||
4 | context.consumeCurrentValue(); | 4 | context.consumeCurrentValue(); |
Row | Violation |
---|---|
1 | Expression context.defineAlias(alias.getNewName(),alias.getOldName()) is a void method call, and thus it cannot be parameterized |
2 | Expression context.aliasGlobal(valiasNode.getNewName(),valiasNode.getOldName()) is a void method call, and thus it cannot be parameterized |
3 | Expression alias cannot be unified with expression valiasNode , because common superclass org.jruby.ast.Node does not declare member(s) public java.lang.String getNewName() , public java.lang.String getOldName() |
4 | Expression alias cannot be unified with expression valiasNode , because common superclass org.jruby.ast.Node does not declare member(s) public java.lang.String getNewName() , public java.lang.String getOldName() |