File path: /sql12/plugins/sqlscript/src/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateDataScriptCommand.java | File path: /sql12/plugins/sqlscript/src/net/sourceforge/squirrel_sql/plugins/sqlscript/table_script/CreateDataScriptCommand.java | |||
Method name: void genInserts(ResultSet, String, StringBuffer, boolean)
|
Method name: void genInserts(ResultSet, String, StringBuffer, boolean)
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
1 | if (iIndex != -1)↵ | 1 | if (iIndex != -1)↵ | |
2 | {↵ | 2 | {↵ | |
3 | int iPrev = 0;↵ | 3 | int iPrev = 0;↵ | |
4 | StringBuffer sb = new StringBuffer();↵ | 4 | StringBuffer sb = new StringBuffer();↵ | |
5 | sb.append(sResult.substring(iPrev, iIndex));↵ | 5 | sb.append(sResult.substring(iPrev, iIndex));↵ | |
6 | sb.append('\'');↵ | 6 | sb.append("\\n");↵ | |
7 | iPrev = iIndex;↵ | 7 | iPrev = iIndex + 1;↵ | |
8 | iIndex = sResult.indexOf("'", iPrev + 1);↵ | 8 | iIndex = sResult.indexOf('\n', iPrev + 1);↵ | |
9 | while (iIndex != -1)↵ | 9 | while (iIndex != -1)↵ | |
10 | {↵ | 10 | {↵ | |
11 | sb.append(sResult.substring(iPrev, iIndex));↵ | 11 | sb.append(sResult.substring(iPrev, iIndex));↵ | |
12 | sb.append('\'');↵ | 12 | sb.append("\\n");↵ | |
13 | iPrev = iIndex;↵ | 13 | iPrev = iIndex + 1;↵ | |
14 | iIndex = sResult.indexOf("'", iPrev + 1);↵ | 14 | iIndex = sResult.indexOf('\n', iPrev + 1);↵ | |
15 | }↵ | 15 | }↵ | |
16 | sb.append(sResult.substring(iPrev));↵ | 16 | sb.append(sResult.substring(iPrev));↵ | |
17 | sResult = sb.toString();↵ | 17 | sResult = sb.toString();↵ | |
18 | } | 18 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 110 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 29.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
75 | if (iIndex != -1) | 90 | if (iIndex != -1) | |||||||||||||
76 | int iPrev = 0; | 91 | int iPrev = 0; | |||||||||||||
77 | StringBuffer sb = new StringBuffer(); | 92 | StringBuffer sb = new StringBuffer(); | |||||||||||||
78 | sb.append(sResult.substring(iPrev, iIndex)); | 93 | sb.append(sResult.substring(iPrev, iIndex)); | |||||||||||||
79 | sb.append('\''); |
| | |||||||||||||
|
| 94 | sb.append("\\n"); | |||||||||||||
80 | iPrev = iIndex; |
| 95 | iPrev = iIndex + 1; | ||||||||||||
81 | iIndex = sResult.indexOf("'", iPrev + 1); |
| | |||||||||||||
|
| 96 | iIndex = sResult.indexOf('\n', iPrev + 1); | |||||||||||||
82 | while (iIndex != -1) | 97 | while (iIndex != -1) | |||||||||||||
83 | sb.append(sResult.substring(iPrev, iIndex)); | 98 | sb.append(sResult.substring(iPrev, iIndex)); | |||||||||||||
84 | sb.append('\''); |
| | |||||||||||||
|
| 99 | sb.append("\\n"); | |||||||||||||
85 | iPrev = iIndex; |
| 100 | iPrev = iIndex + 1; | ||||||||||||
86 | iIndex = sResult.indexOf("'", iPrev + 1); |
| | |||||||||||||
|
| 101 | iIndex = sResult.indexOf('\n', iPrev + 1); | |||||||||||||
87 | sb.append(sResult.substring(iPrev)); | 102 | sb.append(sResult.substring(iPrev)); | |||||||||||||
88 | sResult = sb.toString(); | 103 | sResult = sb.toString(); |
Row | Violation |
---|---|
1 | Unmatched statement sb.append('\''); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement sb.append("\\n"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Expression iIndex + 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement iIndex=sResult.indexOf("'",iPrev + 1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement iIndex=sResult.indexOf('\n',iPrev + 1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement sb.append('\''); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement sb.append("\\n"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Expression iIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression iIndex + 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Unmatched statement iIndex=sResult.indexOf("'",iPrev + 1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
11 | Unmatched statement iIndex=sResult.indexOf('\n',iPrev + 1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |