int index =
_tabbedExecutionsPanel.getUI().tabForCoordinate(_tabbedExecutionsPanel, e.getX(), e.getY());
if (-1 != index)
{
popup.show(e.getComponent(), e.getX(), e.getY());
}
UserScriptAdmin adm = _plugin.getUserScriptAdmin(_session);
if(0 == adm.getTargets(getTargetType()).getAll().length)
{
return;
}
new ScriptListController(_session.getApplication().getMainFrame(), _plugin.getUserScriptAdmin(_session), getTargetType());
Clone fragments detected by clone detection tool
File path: /sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/explain/ExplainExecuterPanel.java
|
|
File path: /sql12/plugins/userscript/src/net/sourceforge/squirrel_sql/plugins/userscript/UserScriptAction.java
|
Method name: void showPopup(MouseEvent, JPopupMenu)
|
|
Method name: void actionPerformed(ActionEvent)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 4
|
|
1 | int index =↵ | | |
|
2 | _tabbedExecutionsPanel.getUI().tabForCoordinate(_tabbedExecutionsPanel, e.getX(), e.getY());↵ | | |
|
3 | if (-1 != index)↵ | | |
|
4 | {↵ | | |
|
5 | popup.show(e.getComponent(), e.getX(), e.getY());↵ | | |
|
6 | } | | 1 | UserScriptAdmin adm = _plugin.getUserScriptAdmin(_session);↵
|
|
| | | 2 | if(0 == adm.getTargets(getTargetType()).getAll().length)↵
|
| | | 3 | {↵
|
| | | 4 | return;↵
|
| | | 5 | }↵
|
|
| | | 6 | new ScriptListController(_session.getApplication().getMainFrame(), _plugin.getUserScriptAdmin(_session), getTargetType());
|
See real code fragment |
|
See real code fragment |
Summary
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 7 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 14.2 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 2 | UserScriptAdmin adm = _plugin.getUserScriptAdmin(_session); |
2 | int index = _tabbedExecutionsPanel.getUI().tabForCoordinate(_tabbedExecutionsPanel, e.getX(), e.getY()); | | | |
3 | if (-1 != index) | | 3 | if (0 == adm.getTargets(getTargetType()).getAll().length) |
| | | 4 | |
4 | popup.show(e.getComponent(), e.getX(), e.getY()); | | | |
| | | 5 | new ScriptListController(_session.getApplication().getMainFrame(), _plugin.getUserScriptAdmin(_session), getTargetType()); |
Precondition Violations (6)
Row |
Violation |
1 | Expression index cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression adm.getTargets(getTargetType()).getAll().length cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression -1 != index cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression 0 == adm.getTargets(getTargetType()).getAll().length cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Unmatched return; |
6 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |