File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/gui/action/TableExportCsvController.java | File path: /sql12/plugins/sessionscript/src/net/sourceforge/squirrel_sql/plugins/sessionscript/ViewSessionScriptsPanel.java | |||
Method name: void onOK()
|
Method name: void refreshScript()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | String sepChar = _dlg.txtSeparatorChar.getText();↵ | |||
2 | if(nul↵ | 1 | AliasScript script = _plugin.getScriptsCache().get(alias);↵ | |
3 | l == sepChar || 1 != sepChar.trim().length())↵ | 2 | String sql = s↵ | |
4 | {↵ | |||
5 | // i18n[TableExportCsvController.invalidSeparator=You must provide a single separator character or check "Use tab" to use the tab character.]↵ | |||
6 | String msg = s_stringMgr.getString("TableExportCsvController.invalidSeparator");↵ | |||
7 | JOptionPane.showMessageDialog(_dlg, msg);↵ | |||
8 | return;↵ | |||
9 | ↵ | 3 | cript.getSQL();↵ | |
4 | if (sql != null && sql.length() > 0)↵ | |||
5 | {↵ | |||
6 | _sqlEntry.setText(sql);↵ | |||
7 | setText = true;↵ | |||
10 | } | 8 | } | |
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 different classes |
Number of node comparisons | 15 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 2.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 4 | AliasScript script = _plugin.getScriptsCache().get(alias); | ||||||||||||||||||||||||||||||||||||||||
| 5 | String sql = script.getSQL(); | ||||||||||||||||||||||||||||||||||||||||
7 | String sepChar = _dlg.txtSeparatorChar.getText(); | | ||||||||||||||||||||||||||||||||||||||||
8 | if (null == sepChar || 1 != sepChar.trim().length()) |
| 6 | if (sql != null && sql.length() > 0) | ||||||||||||||||||||||||||||||||||||||
9 | String msg = s_stringMgr.getString("TableExportCsvController.invalidSeparator"); |
| | |||||||||||||||||||||||||||||||||||||||
10 | JOptionPane.showMessageDialog(_dlg, msg); |
| 7 | _sqlEntry.setText(sql); | ||||||||||||||||||||||||||||||||||||||
| 8 | setText = true; | ||||||||||||||||||||||||||||||||||||||||
11 | return; |
| |
Row | Violation |
---|---|
1 | Expression sql cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression sepChar cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression null == sepChar cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression sql != null cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression sql.length() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression sepChar.trim().length() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression 1 != sepChar.trim().length() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression sql.length() > 0 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression null == sepChar || 1 != sepChar.trim().length() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression sql != null && sql.length() > 0 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Unmatched statement String msg=s_stringMgr.getString("TableExportCsvController.invalidSeparator"); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
12 | Expression JOptionPane.showMessageDialog(_dlg,msg) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression _sqlEntry.setText(sql) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression JOptionPane.showMessageDialog(_dlg,msg) is a void method call, and thus it cannot be parameterized |
15 | Expression _sqlEntry.setText(sql) is a void method call, and thus it cannot be parameterized |
16 | Expression JOptionPane.showMessageDialog(_dlg,msg) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
17 | Expression _sqlEntry.setText(sql) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
18 | Expression JOptionPane.showMessageDialog(_dlg,msg) is a void method call, and thus it cannot be parameterized |
19 | Expression _sqlEntry.setText(sql) is a void method call, and thus it cannot be parameterized |
20 | Unmatched return; |