File path: /jruby-1.4.0/src/org/jruby/javasupport/util/RuntimeHelpers.java | File path: /jruby-1.4.0/src/org/jruby/ast/ClassVarAsgnNode.java | |||
Method name: IRubyObject fastFetchClassVariable(ThreadContext, Ruby, IRubyObject, String)
|
Method name: IRubyObject interpret(Ruby, ThreadContext, IRubyObject, Block)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | RubyModule rubyClass = ASTInterpreter.getClassVariableBase(context, runtime);↵ | 1 | RubyModule rubyClass = ASTInterpreter.getClassVariableBase(context, runtime);↵ | |
2 | ↵ | 2 | ↵ | |
3 | if (rubyClass == null) rubyClass = self.getMetaClass();↵ | 3 | if (rubyClass == null) rubyClass = self.getMetaClass();↵ | |
4 | return rubyClass.fastGetClassVar(internedName); | 4 | return rubyClass.fastSetClassVar(name, getValueNode().interpret(runtime, context, self, aBlock)); | |
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 in different classes |
Number of node comparisons | 8 |
Number of mapped statements | 4 |
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) | 1.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | RubyModule rubyClass = ASTInterpreter.getClassVariableBase(context, runtime); | 1 | RubyModule rubyClass = ASTInterpreter.getClassVariableBase(context, runtime); | ||||||||||||||||||
2 | if (rubyClass == null) | 2 | if (rubyClass == null) | ||||||||||||||||||
3 | rubyClass = self.getMetaClass(); | 3 | rubyClass = self.getMetaClass(); | ||||||||||||||||||
4 | return rubyClass.fastGetClassVar(internedName); |
| 4 | return rubyClass.fastSetClassVar(name, getValueNode().interpret(runtime, context, self, aBlock)); |
Row | Violation |
---|---|
1 | Expression rubyClass.fastGetClassVar(internedName) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression rubyClass.fastSetClassVar(name,getValueNode().interpret(runtime,context,self,aBlock)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression rubyClass.fastGetClassVar(internedName) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression rubyClass.fastSetClassVar(name,getValueNode().interpret(runtime,context,self,aBlock)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |