File path: /jruby-1.4.0/src/org/jruby/javasupport/proxy/JavaProxyClass.java | File path: /jruby-1.4.0/src/org/jruby/platform/Platform.java | |||
Method name: RubyObject get_with_class(IRubyObject, IRubyObject)
|
Method name: String initOperatingSystem()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 3 | |||
1 | for (String methodName: methods.keySet()) {↵ | 1 | for (String ↵ | |
2 | if (!EXCLUDE_METHODS.contains(methodName)) {↵ | |||
3 | names.add(methodN↵ | 2 | s : OS_NAMES.keySet()) {↵ | |
4 | ame);↵ | 3 | if (s.equalsIgnoreCase(osname)) {↵ | |
5 | methodNames.append(runtime.newString(methodName));↵ | 4 | ↵ | |
6 | }↵ | |||
7 | ↵ | 5 | return OS_NAMES.get(s);↵ | |
6 | }↵ | |||
8 | } | 7 |
| |
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 | 8 |
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) | 2.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
48 | for (String methodName : methods.keySet()) |
| 2 | for (String s : OS_NAMES.keySet()) | |||||||||||||||||
49 | if (!EXCLUDE_METHODS.contains(methodName)) |
| 3 | if (s.equalsIgnoreCase(osname)) | |||||||||||||||||
|
| 4 | return OS_NAMES.get(s); | ||||||||||||||||||
50 | names.add(methodName); |
| | ||||||||||||||||||
51 | methodNames.append(runtime.newString(methodName)); |
| |
Row | Violation |
---|---|
1 | Type java.util.Map<java.lang.String,org.jruby.internal.runtime.methods.DynamicMethod> of variable methods does not match with type java.util.Map<java.lang.String,java.lang.String> of variable OS_NAMES |
2 | Expression !EXCLUDE_METHODS.contains(methodName) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression s.equalsIgnoreCase(osname) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement return OS_NAMES.get(s); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched return OS_NAMES.get(s); |
6 | Unmatched statement names.add(methodName); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement methodNames.append(runtime.newString(methodName)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |