File path: /jruby-1.4.0/src/org/jruby/compiler/ir/IR_Builder.java | File path: /jruby-1.4.0/src/org/jruby/compiler/ir/IR_Builder.java | |||
Method name: Operand buildDRegexp(DRegexpNode, IR_Scope)
|
Method name: Operand buildDXStr(DXStrNode, IR_Scope)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | List<Operand> strPieces = new ArrayList<Operand>();↵ | 1 | List<Operand> strPieces = new ArrayList<Operand>();↵ | |
2 | for (Node n : dregexpNode.childNodes())↵ | 2 | for (Node nextNode : dstrNode.childNodes())↵ | |
3 | strPieces.add(build(n, s));↵ | 3 | strPieces.add(build(nextNode, m));↵ | |
4 | return new Regexp(new CompoundString(strPieces), dregexpNode.getOptions()); | 4 | return new BacktickString(strPieces); | |
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
Number of mapped statements | 4 |
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) | 49.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | List<Operand> strPieces = new ArrayList<Operand>(); | 1 | List<Operand> strPieces = new ArrayList<Operand>(); | ||||||||||||||||||
2 | for (Node n : dregexpNode.childNodes()) |
| 2 | for (Node nextNode : dstrNode.childNodes()) | |||||||||||||||||
3 | strPieces.add(build(n, s)); |
| 3 | strPieces.add(build(nextNode, m)); | |||||||||||||||||
4 | return new Regexp(new CompoundString(strPieces), dregexpNode.getOptions()); |
| 4 | return new BacktickString(strPieces); |
Row | Violation |
---|---|
1 | Expression new Regexp(new CompoundString(strPieces),dregexpNode.getOptions()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new BacktickString(strPieces) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression new Regexp(new CompoundString(strPieces),dregexpNode.getOptions()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new BacktickString(strPieces) cannot be parameterized, because it has dependencies to/from statements that will be extracted |