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 compileGlobalVar(Node, BodyCompiler, boolean)
|
Method name: void compileGlobalAsgnAssignment(Node, BodyCompiler, boolean)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | switch (globalVarNode.getName().charAt(1)) {↵ | 1 | switch (globalAsgnNode.getName().charAt(1)) {↵ | |
2 | case '_':↵ | 2 | case '_':↵ | |
3 | context.getVariableCompiler().retrieveLastLine();↵ | 3 | context.getVariableCompiler().assignLastLine();↵ | |
4 | break;↵ | 4 | break;↵ | |
5 | case '~':↵ | 5 | case '~':↵ | |
6 | context.getVariableCompiler().retrieveBackRef();↵ | 6 | context.getVariableCompiler().assignBackRef();↵ | |
7 | break;↵ | 7 | break;↵ | |
8 | default:↵ | 8 | default:↵ | |
9 | context.retrieveGlobalVariable(globalVarNode.getName());↵ | 9 | context.assignGlobalVariable(globalAsgnNode.getName());↵ | |
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 | 45 |
Number of mapped statements | 9 |
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) | 6.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6 | switch (globalVarNode.getName().charAt(1)) |
| 3 | switch (globalAsgnNode.getName().charAt(1)) | |||||||||||||||||||
7 | case '_': | 4 | case '_': | ||||||||||||||||||||
8 | context.getVariableCompiler().retrieveLastLine(); |
| 5 | context.getVariableCompiler().assignLastLine(); | |||||||||||||||||||
9 | break; | 6 | break; | ||||||||||||||||||||
10 | case '~': | 7 | case '~': | ||||||||||||||||||||
11 | context.getVariableCompiler().retrieveBackRef(); |
| 8 | context.getVariableCompiler().assignBackRef(); | |||||||||||||||||||
12 | break; | 9 | break; | ||||||||||||||||||||
13 | default: | 10 | default: | ||||||||||||||||||||
14 | context.retrieveGlobalVariable(globalVarNode.getName()); |
| 11 | context.assignGlobalVariable(globalAsgnNode.getName()); |
Row | Violation |
---|---|
1 | Expression globalVarNode cannot be unified with expression globalAsgnNode , because common superclass org.jruby.ast.Node does not declare member(s) public java.lang.String getName() |
2 | Expression context.getVariableCompiler().retrieveLastLine() is a void method call, and thus it cannot be parameterized |
3 | Expression context.getVariableCompiler().assignLastLine() is a void method call, and thus it cannot be parameterized |
4 | Expression context.getVariableCompiler().retrieveBackRef() is a void method call, and thus it cannot be parameterized |
5 | Expression context.getVariableCompiler().assignBackRef() is a void method call, and thus it cannot be parameterized |
6 | Expression context.retrieveGlobalVariable(globalVarNode.getName()) is a void method call, and thus it cannot be parameterized |
7 | Expression context.assignGlobalVariable(globalAsgnNode.getName()) is a void method call, and thus it cannot be parameterized |
8 | Expression globalVarNode cannot be unified with expression globalAsgnNode , because common superclass org.jruby.ast.Node does not declare member(s) public java.lang.String getName() |