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 lstrip_bang19(ThreadContext)
|
Method name: IRubyObject strip_bang19(ThreadContext)
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
1 | Ruby runtime = context.getRuntime();↵ | 1 | Ruby runtime = context.getRuntime();↵ | |
2 | if (value.realSize == 0) {↵ | 2 | if (value.realSize == 0) {↵ | |
3 | modifyCheck();↵ | 3 | modifyCheck();↵ | |
4 | return runtime.getNil();↵ | 4 | return runtime.getNil();↵ | |
5 | }↵ | 5 | }↵ | |
6 | Encoding enc = value.encoding;↵ | 6 | Encoding enc = value.encoding;↵ | |
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 | final IRubyObject result;↵ | 10 | final IRubyObject result;↵ | |
11 | if (singleByteOptimizable(enc)) {↵ | 11 | if (singleByteOptimizable(enc)) {↵ | |
12 | result = singleByteLStrip(runtime, enc, bytes, s, end);↵ | 12 | result = singleByteStrip(runtime, enc, bytes, s, end);↵ | |
13 | } else {↵ | 13 | } else {↵ | |
14 | result = multiByteLStrip(runtime, enc, bytes, s, end);↵ | 14 | result = multiByteStrip(runtime, enc, bytes, s, end);↵ | |
15 | }↵ | 15 | }↵ | |
16 | keepCodeRange();↵ | 16 | keepCodeRange();↵ | |
17 | return result; | 17 |
| |
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 | 92 |
Number of mapped statements | 14 |
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) | 7.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Ruby runtime = context.getRuntime(); | 1 | Ruby runtime = context.getRuntime(); | |||||||||||||
2 | if (value.realSize == 0) | 2 | if (value.realSize == 0) | |||||||||||||
3 | modifyCheck(); | 3 | modifyCheck(); | |||||||||||||
4 | return runtime.getNil(); | 4 | return runtime.getNil(); | |||||||||||||
5 | Encoding enc = value.encoding; | 5 | Encoding enc = value.encoding; | |||||||||||||
6 | int s = value.begin; | 6 | int s = value.begin; | |||||||||||||
7 | int end = s + value.realSize; | 7 | int end = s + value.realSize; | |||||||||||||
8 | byte[] bytes = value.bytes; | 8 | byte[] bytes = value.bytes; | |||||||||||||
9 | final IRubyObject result; | 9 | final IRubyObject result; | |||||||||||||
10 | if (singleByteOptimizable(enc)) | 10 | if (singleByteOptimizable(enc)) | |||||||||||||
11 | result = singleByteLStrip(runtime, enc, bytes, s, end); |
| 11 | result = singleByteStrip(runtime, enc, bytes, s, end); | ||||||||||||
else | else | |||||||||||||||
12 | result = multiByteLStrip(runtime, enc, bytes, s, end); |
| 12 | result = multiByteStrip(runtime, enc, bytes, s, end); | ||||||||||||
13 | keepCodeRange(); | 13 | keepCodeRange(); | |||||||||||||
14 | return result; | 14 | return result; |
Row | Violation |
---|---|
1 | Expression singleByteLStrip(runtime,enc,bytes,s,end) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression singleByteStrip(runtime,enc,bytes,s,end) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression multiByteLStrip(runtime,enc,bytes,s,end) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression multiByteStrip(runtime,enc,bytes,s,end) cannot be parameterized, because it has dependencies to/from statements that will be extracted |