File path: /jruby-1.4.0/src/org/jruby/anno/AnnotationBinder.java | File path: /jruby-1.4.0/src/org/jruby/anno/AnnotationBinder.java | |||
Method name: int calculateActualRequired(int, int, boolean, boolean, boolean, boolean)
|
Method name: int calculateActualRequired(int, int, boolean, boolean, boolean, boolean)
|
|||
Number of AST nodes: 13 | Number of AST nodes: 10 | |||
1 | int args = paramsLength;↵ | 1 | int args = paramsLength;↵ | |
2 | if (args == 0) {↵ | 2 | if (args == 0) {↵ | |
3 | actualRequired = 0;↵ | 3 | actualRequired = 0;↵ | |
4 | } else {↵ | 4 | } else {↵ | |
5 | if (isStatic) {↵ | 5 | if (isStatic) {↵ | |
6 | args--;↵ | 6 | args--;↵ | |
7 | }↵ | 7 | }↵ | |
8 | if (hasContext) {↵ | 8 | if (hasContext) {↵ | |
9 | args--;↵ | 9 | args--;↵ | |
10 | }↵ | 10 | }↵ | |
11 | if (hasBlock) {↵ | 11 | if (hasBlock) {↵ | |
12 | args--; // minus one more for IRubyObject[]↵ | 12 | args--;↵ | |
13 | }↵ | |||
14 | args--;↵ | |||
15 | // TODO: confirm expected args are IRubyObject (or similar)↵ | 13 | // TODO: confirm expected args are IRubyObject (or similar)↵ | |
16 | actualRequired = args;↵ | 14 | ↵ | |
17 | }↵ | |||
18 | if (↵ | 15 | }↵ | |
19 | actualRequired != 0) {↵ | 16 | actualRequired = ↵ | |
20 | throw new RuntimeException("Combining specific args with IRubyObject[] is not yet supported");↵ | 17 | args;↵ | |
21 | } | 18 |
| |
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.7 |
Clones location | Clones are in the same method |
Number of node comparisons | 41 |
Number of mapped statements | 10 |
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) | 2.3 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
13 | int args = paramsLength; | 3 | int args = paramsLength; | ||||
14 | if (args == 0) | 4 | if (args == 0) | ||||
15 | actualRequired = 0; | 5 | actualRequired = 0; | ||||
else | else | ||||||
16 | if (isStatic) | 6 | if (isStatic) | ||||
17 | args--; | 7 | args--; | ||||
18 | if (hasContext) | 8 | if (hasContext) | ||||
19 | args--; | 9 | args--; | ||||
20 | if (hasBlock) | 10 | if (hasBlock) | ||||
21 | args--; | 11 | args--; | ||||
22 | args--; |
| | ||||
23 | actualRequired = args; | 12 | actualRequired = args; |
Row | Violation |
---|---|
1 | Unmatched statement args--; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Clone fragment #1 returns variables args, actualRequired , while Clone fragment #2 returns variables actualRequired |