File path: /sql12/plugins/editextras/src/net/sourceforge/squirrel_sql/plugins/editextras/InQuotesCommand.java | File path: /sql12/plugins/editextras/src/net/sourceforge/squirrel_sql/plugins/editextras/RemoveQuotesCommand.java | |||
Method name: void quoteSQL(ISQLEntryPanel, boolean)
|
Method name: void unquoteSQL(ISQLEntryPanel)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | int[] bounds = entryPanel.getBoundsOfSQLToBeExecuted();↵ | 1 | int[] bounds = entryPanel.getBoundsOfSQLToBeExecuted();↵ | |
2 | if(bounds[0] == bounds[1])↵ | 2 | if(bounds[0] == bounds[1])↵ | |
3 | {↵ | 3 | {↵ | |
4 | return;↵ | 4 | return;↵ | |
5 | }↵ | 5 | }↵ | |
6 | String textToQuote = entryPanel.getSQLToBeExecuted();↵ | 6 | String textToUnquote = entryPanel.getSQLToBeExecuted();↵ | |
7 | if (null == textToQuote)↵ | 7 | if (null == textToUnquote)↵ | |
8 | {↵ | 8 | {↵ | |
9 | return;↵ | 9 | return;↵ | |
10 | }↵ | 10 | }↵ | |
11 | String quotedText = Utilities.quoteText(textToQuote, sbAppend);↵ | 11 | String unquotedText = Utilities.unquoteText(textToUnquote);↵ | |
12 | entryPanel.setSelectionStart(bounds[0]);↵ | 12 | entryPanel.setSelectionStart(bounds[0]);↵ | |
13 | entryPanel.setSelectionEnd(bounds[1]);↵ | 13 | entryPanel.setSelectionEnd(bounds[1]);↵ | |
14 | entryPanel.replaceSelection(quotedText); | 14 | entryPanel.replaceSelection(unquotedText); | |
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 different classes |
Number of node comparisons | 46 |
Number of mapped statements | 10 |
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) | 5.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | int[] bounds = entryPanel.getBoundsOfSQLToBeExecuted(); | 1 | int[] bounds = entryPanel.getBoundsOfSQLToBeExecuted(); | |||||||||||||||||||||
2 | if (bounds[0] == bounds[1]) | 2 | if (bounds[0] == bounds[1]) | |||||||||||||||||||||
3 | return; | 3 | return; | |||||||||||||||||||||
4 | String textToQuote = entryPanel.getSQLToBeExecuted(); |
| 4 | String textToUnquote = entryPanel.getSQLToBeExecuted(); | ||||||||||||||||||||
5 | if (null == textToQuote) |
| 5 | if (null == textToUnquote) | ||||||||||||||||||||
6 | return; | 6 | return; | |||||||||||||||||||||
7 | String quotedText = Utilities.quoteText(textToQuote, sbAppend); |
| 7 | String unquotedText = Utilities.unquoteText(textToUnquote); | ||||||||||||||||||||
8 | entryPanel.setSelectionStart(bounds[0]); | 8 | entryPanel.setSelectionStart(bounds[0]); | |||||||||||||||||||||
9 | entryPanel.setSelectionEnd(bounds[1]); | 9 | entryPanel.setSelectionEnd(bounds[1]); | |||||||||||||||||||||
10 | entryPanel.replaceSelection(quotedText); |
| 10 | entryPanel.replaceSelection(unquotedText); |
Row | Violation |
---|---|
1 | Expression Utilities.quoteText(textToQuote,sbAppend) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression Utilities.unquoteText(textToUnquote) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression Utilities.quoteText(textToQuote,sbAppend) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression Utilities.unquoteText(textToUnquote) cannot be parameterized, because it has dependencies to/from statements that will be extracted |