File path: /jruby-1.4.0/src/org/jruby/compiler/impl/BaseBodyCompiler.java | File path: /jruby-1.4.0/src/org/jruby/compiler/impl/BaseBodyCompiler.java | |||
Method name: void performRescue(BranchCallback, BranchCallback, boolean)
|
Method name: void performBooleanLoopSafe(BranchCallback, BranchCallback, boolean)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 3 | |||
1 | String mname = getNewRescueName();↵ | 1 | String mname = getNewRescueName();↵ | |
2 | BaseBodyCompiler rescueMethod = outline(mname);↵ | 2 | BaseBodyCompiler nested = outline(mname);↵ | |
3 | rescueMethod.performRescueLight(regularCode, rubyCatchCode, needsRetry);↵ | 3 | nested.performBooleanLoopSafeInner(condition, body, ↵ | |
4 | rescueMethod.endBody(); | 4 | checkFirst); | |
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 6 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String mname = getNewRescueName(); | 1 | String mname = getNewRescueName(); | |||||||||||||||||||||||||
2 | BaseBodyCompiler rescueMethod = outline(mname); |
| 2 | BaseBodyCompiler nested = outline(mname); | ||||||||||||||||||||||||
3 | rescueMethod.performRescueLight(regularCode, rubyCatchCode, needsRetry); |
| | |||||||||||||||||||||||||
4 | rescueMethod.endBody(); |
| 3 | nested.performBooleanLoopSafeInner(condition, body, checkFirst); |
Row | Violation |
---|---|
1 | Unmatched statement rescueMethod.performRescueLight(regularCode,rubyCatchCode,needsRetry); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Expression rescueMethod.endBody() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression nested.performBooleanLoopSafeInner(condition,body,checkFirst) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression rescueMethod.endBody() is a void method call, and thus it cannot be parameterized |
5 | Expression nested.performBooleanLoopSafeInner(condition,body,checkFirst) is a void method call, and thus it cannot be parameterized |
6 | Expression rescueMethod.endBody() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression nested.performBooleanLoopSafeInner(condition,body,checkFirst) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression rescueMethod.endBody() is a void method call, and thus it cannot be parameterized |
9 | Expression nested.performBooleanLoopSafeInner(condition,body,checkFirst) is a void method call, and thus it cannot be parameterized |
10 | Clone fragment #1 returns variables rescueMethod , while Clone fragment #2 returns variables |