File path: /jruby-1.4.0/src/org/jruby/ast/DefinedNode.java | File path: /jruby-1.4.0/src/org/jruby/evaluator/ASTInterpreter.java | |||
Method name: IRubyObject interpret(Ruby, ThreadContext, IRubyObject, Block)
|
Method name: String getDefinition(Ruby, ThreadContext, Node, IRubyObject, Block)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 3 | |||
1 | try {↵ | 1 | try {↵ | |
2 | context.setWithinDefined(true);↵ | 2 | context.setWithinDefined(true);↵ | |
3 | String definition = expressionNode.definition(runtime, context, self, aBlock);↵ | 3 | return node.definition(runtime, context, self, aBlock);↵ | |
4 | return definition != null ? runtime.newString(definition) : runtime.getNil();↵ | |||
5 | } finally {↵ | 4 | } finally {↵ | |
6 | context.setWithinDefined(false);↵ | 5 | context.setWithinDefined(false);↵ | |
7 | } | 6 |
| |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 12 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.4 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
1 | try | 1 | try | ||||
2 | context.setWithinDefined(true); | 2 | context.setWithinDefined(true); | ||||
|
| 3 | return node.definition(runtime, context, self, aBlock); | ||||
3 | String definition = expressionNode.definition(runtime, context, self, aBlock); |
| | ||||
4 | return definition != null ? runtime.newString(definition) : runtime.getNil(); |
| |
Row | Violation |
---|---|
1 | Unmatched return node.definition(runtime,context,self,aBlock); |
2 | Unmatched statement String definition=expressionNode.definition(runtime,context,self,aBlock); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
3 | Unmatched return definition != null ? runtime.newString(definition) : runtime.getNil(); |