File path: /jruby-1.4.0/src/org/jruby/RubyString.java | File path: /jruby-1.4.0/src/org/jruby/RubyString.java | |||
Method name: IRubyObject upcase_bang19(ThreadContext)
|
Method name: IRubyObject downcase_bang19(ThreadContext)
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | Ruby runtime = context.getRuntime();↵ | 1 | Ruby runtime = context.getRuntime();↵ | |
2 | Encoding enc = checkDummyEncoding();↵ | 2 | Encoding enc = checkDummyEncoding();↵ | |
3 | if (value.realSize == 0) {↵ | 3 | if (value.realSize == 0) {↵ | |
4 | modifyCheck();↵ | 4 | modifyCheck();↵ | |
5 | return runtime.getNil();↵ | 5 | return runtime.getNil();↵ | |
6 | }↵ | 6 | }↵ | |
7 | modifyAndKeepCodeRange();↵ | 7 | modifyAndKeepCodeRange();↵ | |
8 | int s = value.begin;↵ | 8 | int s = value.begin;↵ | |
9 | int end = s + value.realSize;↵ | 9 | int end = s + value.realSize;↵ | |
10 | byte[]bytes = value.bytes;↵ | 10 | byte[]bytes = value.bytes;↵ | |
11 | if (singleByteOptimizable(enc)) {↵ | 11 | if (singleByteOptimizable(enc)) {↵ | |
12 | return singleByteUpcase(runtime, bytes, s, end);↵ | 12 | return singleByteDowncase(runtime, bytes, s, end);↵ | |
13 | } else {↵ | 13 | } else {↵ | |
14 | return multiByteUpcase(runtime, enc, bytes, s, end);↵ | 14 | return multiByteDowncase(runtime, enc, bytes, s, end);↵ | |
15 | } | 15 |
| |
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 54 |
Number of mapped statements | 12 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 47.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Ruby runtime = context.getRuntime(); | 1 | Ruby runtime = context.getRuntime(); | |||||||||||||
2 | Encoding enc = checkDummyEncoding(); | 2 | Encoding enc = checkDummyEncoding(); | |||||||||||||
3 | if (value.realSize == 0) | 3 | if (value.realSize == 0) | |||||||||||||
4 | modifyCheck(); | 4 | modifyCheck(); | |||||||||||||
5 | return runtime.getNil(); | 5 | return runtime.getNil(); | |||||||||||||
6 | modifyAndKeepCodeRange(); | 6 | modifyAndKeepCodeRange(); | |||||||||||||
7 | int s = value.begin; | 7 | int s = value.begin; | |||||||||||||
8 | int end = s + value.realSize; | 8 | int end = s + value.realSize; | |||||||||||||
9 | byte[] bytes = value.bytes; | 9 | byte[] bytes = value.bytes; | |||||||||||||
10 | if (singleByteOptimizable(enc)) | 10 | if (singleByteOptimizable(enc)) | |||||||||||||
11 | return singleByteUpcase(runtime, bytes, s, end); |
| 11 | return singleByteDowncase(runtime, bytes, s, end); | ||||||||||||
else | else | |||||||||||||||
12 | return multiByteUpcase(runtime, enc, bytes, s, end); |
| 12 | return multiByteDowncase(runtime, enc, bytes, s, end); |
Row | Violation |
---|---|
1 | Expression singleByteUpcase(runtime,bytes,s,end) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression singleByteDowncase(runtime,bytes,s,end) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression multiByteUpcase(runtime,enc,bytes,s,end) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression multiByteDowncase(runtime,enc,bytes,s,end) cannot be parameterized, because it has dependencies to/from statements that will be extracted |