File path: /jruby-1.4.0/src/org/jruby/parser/StaticScope.java | File path: /jruby-1.4.0/src/org/jruby/parser/StaticScope.java | |||
Method name: int addVariable(String)
|
Method name: int addVariableThisScope(String)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | int slot = isDefined(name); ↵ | 1 | int slot = exists(name);↵ | |
2 | if (slot >= 0) return slot;↵ | 2 | if (slot >= 0) return slot;↵ | |
3 | ↵ | |||
4 | // This is perhaps innefficient timewise? Optimal spacewise↵ | 3 | // This is perhaps innefficient timewise? Optimal spacewise↵ | |
5 | growVariableNames(name);↵ | 4 | growVariableNames(name);↵ | |
6 | ↵ | |||
7 | // Returns slot of variable↵ | 5 | // Returns slot of variable↵ | |
8 | return variableNames.length - 1; | 6 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
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 | 9 |
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) | 0.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | int slot = isDefined(name); |
| 1 | int slot = exists(name); | ||||||||||
2 | if (slot >= 0) | 2 | if (slot >= 0) | |||||||||||
3 | return slot; | 3 | return slot; | |||||||||||
4 | growVariableNames(name); | 4 | growVariableNames(name); | |||||||||||
5 | return variableNames.length - 1; | 5 | return variableNames.length - 1; |
Row | Violation |
---|