File path: /jruby-1.4.0/src/org/jruby/javasupport/proxy/JavaProxyClass.java | File path: /jruby-1.4.0/src/org/jruby/javasupport/proxy/JavaProxyConstructor.java | |||
Method name: IRubyObject inspect()
|
Method name: IRubyObject inspect()
|
|||
Number of AST nodes: 10 | Number of AST nodes: 9 | |||
1 | StringBuilder result = new StringBuilder();↵ | 1 | StringBuilder result = new StringBuilder();↵ | |
2 | result.append(nameOnInspection());↵ | 2 | result.append(nameOnInspection());↵ | |
3 | result.append("(");↵ | 3 | ↵ | |
4 | Class[] parameterTypes = getParameterTypes();↵ | 4 | Class<?>[] parameterTypes = getParameterTypes();↵ | |
5 | for (int i = 0; i < parameterTypes.length; i++) {↵ | 5 | for (int i = 0; i < parameterTypes.length; i++) {↵ | |
6 | result.append(parameterTypes[i].getName());↵ | 6 | result.append(parameterTypes[i].getName());↵ | |
7 | if (i < parameterTypes.length - 1) {↵ | 7 | if (i < parameterTypes.length - 1) {↵ | |
8 | result.append(',');↵ | 8 | result.append(',');↵ | |
9 | }↵ | 9 | ↵ | |
10 | }↵ | 10 | }↵ | |
11 | ↵ | 11 | }↵ | |
12 | result.append(")>");↵ | 12 | result.append(")>");↵ | |
13 | return getRuntime().newString(result.toString()); | 13 |
| |
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 different classes having the same super class |
Number of node comparisons | 26 |
Number of mapped statements | 8 |
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) | 2.2 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | StringBuilder result = new StringBuilder(); | 1 | StringBuilder result = new StringBuilder(); | ||||||||||||
2 | result.append(nameOnInspection()); |
| | ||||||||||||
3 | result.append("("); |
| 2 | result.append(nameOnInspection()); | |||||||||||
| 3 | Class<?>[] parameterTypes = getParameterTypes(); | |||||||||||||
4 | Class[] parameterTypes = getParameterTypes(); | | |||||||||||||
5 | for (int i = 0; i < parameterTypes.length; i++) |
| 4 | for (int i = 0; i < parameterTypes.length; i++) | |||||||||||
6 | result.append(parameterTypes[i].getName()); |
| 5 | result.append(parameterTypes[i].getName()); | |||||||||||
7 | if (i < parameterTypes.length - 1) |
| 6 | if (i < parameterTypes.length - 1) | |||||||||||
8 | result.append(','); | 7 | result.append(','); | ||||||||||||
9 | result.append(")>"); | 8 | result.append(")>"); | ||||||||||||
10 | return getRuntime().newString(result.toString()); | 9 | return getRuntime().newString(result.toString()); |
Row | Violation |
---|---|
1 | Unmatched statement result.append(nameOnInspection()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Type java.lang.Class[] of variable parameterTypes does not match with type java.lang.Class<?>[] of variable parameterTypes |
3 | Type java.lang.Class[] of variable parameterTypes does not match with type java.lang.Class<?>[] of variable parameterTypes |
4 | Type java.lang.Class[] of variable parameterTypes does not match with type java.lang.Class<?>[] of variable parameterTypes |
5 | Clone fragment #1 returns variables result , while Clone fragment #2 returns variables |