File path: /jEdit-4.2/src/bsh/BSHSwitchStatement.java | File path: /jEdit-4.2/src/bsh/BSHSwitchStatement.java | |||
Method name: Object eval(CallStack, Interpreter)
|
Method name: Object eval(CallStack, Interpreter)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 5 | |||
1 | while ( child < numchild ) ↵ | 1 | while ( child < numchild ) ↵ | |
2 | {↵ | 2 | {↵ | |
3 | node = jjtGetChild(child++);↵ | 3 | node = jjtGetChild(child++);↵ | |
4 | if ( node instanceof BSHSwitchLabel )↵ | 4 | if ( node instanceof BSHSwitchLabel )↵ | |
5 | continue;↵ | |||
6 | // eval it↵ | |||
7 | Object value = ↵ | |||
8 | ((SimpleNode)node).eval( callstack, interpreter ); ↵ | |||
9 | // should check to disallow continue here?↵ | |||
10 | if ( value instanceof ReturnControl ) {↵ | |||
11 | returnControl = (ReturnControl)valu↵ | 5 | {↵ | |
12 | e;↵ | 6 | label = (BSHSwitchLabel)node;↵ | |
13 | break;↵ | 7 | break;↵ | |
14 | }↵ | 8 | }↵ | |
15 | } | 9 |
| |
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.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 16 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.4 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
13 | while (child < numchild) | 21 | while (child < numchild) | ||||
14 | node = jjtGetChild(child++); | 22 | node = jjtGetChild(child++); | ||||
15 | if (node instanceof BSHSwitchLabel) | 23 | if (node instanceof BSHSwitchLabel) | ||||
16 | continue; |
| | ||||
|
| 24 | label = (BSHSwitchLabel)node; | ||||
|
| 25 | break; | ||||
17 | Object value = ((SimpleNode)node).eval(callstack, interpreter); |
| |
Row | Violation |
---|---|
1 | Unmatched continue; |
2 | Unmatched statement label=(BSHSwitchLabel)node; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched break; |
4 | Unmatched statement Object value=((SimpleNode)node).eval(callstack,interpreter); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Clone fragment #1 returns variables child, node , while Clone fragment #2 returns variables child, node |