File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/codereformat/CodeReformatorKernel.java | File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/codereformat/CodeReformatorKernel.java | |||
Method name: String[] toPieces(String)
|
Method name: String[] toPieces(String)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | if(nextP.beginsAt + nextP.spec.getLengthRightSpaced() < in.length())↵ | 1 | if(p.beginsAt + p.spec.getLengthRightSpaced() < in.length())↵ | |
2 | {↵ | 2 | {↵ | |
3 | ret.add( in.substring(p.beginsAt, nextP.beginsAt + nextP.spec.getLengthRightSpaced()).trim() );↵ | 3 | ret.add( in.substring(begin, p.beginsAt + p.spec.getLengthRightSpaced() ).trim() );↵ | |
4 | }↵ | 4 | }↵ | |
5 | else↵ | 5 | else↵ | |
6 | {↵ | 6 | ↵ | |
7 | ↵ | 7 | {↵ | |
8 | ret.add( in.substring(p.beginsAt).trim() );↵ | 8 | ret.add( in.substring(begin).trim() );↵ | |
9 | } | 9 | } | |
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 in the same method |
Number of node comparisons | 11 |
Number of mapped statements | 3 |
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) | 3.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
22 | if (nextP.beginsAt + nextP.spec.getLengthRightSpaced() < in.length()) |
| 30 | if (p.beginsAt + p.spec.getLengthRightSpaced() < in.length()) | ||||||||||||||||||||
23 | ret.add(in.substring(p.beginsAt, nextP.beginsAt + nextP.spec.getLengthRightSpaced()).trim()); |
| 31 | ret.add(in.substring(begin, p.beginsAt + p.spec.getLengthRightSpaced()).trim()); | ||||||||||||||||||||
else | else | |||||||||||||||||||||||
24 | ret.add(in.substring(p.beginsAt).trim()); |
| 32 | ret.add(in.substring(begin).trim()); |
Row | Violation |
---|---|
1 | Expression nextP.beginsAt cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression p.beginsAt cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression nextP.spec cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression p.spec cannot be parameterized, because it has dependencies to/from statements that will be extracted |