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 chomp_bang(ThreadContext)
|
Method name: IRubyObject chomp_bang19(ThreadContext)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | Ruby runtime = context.getRuntime();↵ | 1 | Ruby runtime = context.getRuntime();↵ | |
2 | if (value.realSize == 0) return runtime.getNil();↵ | 2 | if (value.realSize == 0) return runtime.getNil();↵ | |
3 | IRubyObject rsObj = runtime.getGlobalVariables().get("$/");↵ | 3 | IRubyObject rsObj = runtime.getGlobalVariables().get("$/");↵ | |
4 | if (rsObj == runtime.getGlobalVariables().getDefaultSeparator()) return smartChopBangCommon(runtime);↵ | 4 | if (rsObj == runtime.getGlobalVariables().getDefaultSeparator()) return smartChopBangCommon19(runtime);↵ | |
5 | return chompBangCommon(runtime, rsObj); | 5 | return chompBangCommon19(runtime, rsObj); | |
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.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 18 |
Number of mapped statements | 7 |
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) | 2.4 |
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 | return runtime.getNil(); | 3 | return runtime.getNil(); | |||||||||||||
4 | IRubyObject rsObj = runtime.getGlobalVariables().get("$/"); | 4 | IRubyObject rsObj = runtime.getGlobalVariables().get("$/"); | |||||||||||||
5 | if (rsObj == runtime.getGlobalVariables().getDefaultSeparator()) | 5 | if (rsObj == runtime.getGlobalVariables().getDefaultSeparator()) | |||||||||||||
6 | return smartChopBangCommon(runtime); |
| 6 | return smartChopBangCommon19(runtime); | ||||||||||||
7 | return chompBangCommon(runtime, rsObj); |
| 7 | return chompBangCommon19(runtime, rsObj); |
Row | Violation |
---|---|
1 | Expression smartChopBangCommon(runtime) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression smartChopBangCommon19(runtime) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression chompBangCommon(runtime,rsObj) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression chompBangCommon19(runtime,rsObj) cannot be parameterized, because it has dependencies to/from statements that will be extracted |