File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/dnd/EditingDomainViewerDropAdapter.java | File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/dnd/EditingDomainViewerDropAdapter.java | |||
Method name: float getLocation(DropTargetEvent)
|
Method name: float getLocation(DropTargetEvent)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | TableItem tableItem = (TableItem)event.item;↵ | 1 | TreeItem treeItem = (TreeItem)event.item;↵ | |
2 | Control control = tableItem.getParent();↵ | 2 | Control control = treeItem.getParent();↵ | |
3 | Point point = control.toControl(new Point(event.x, event.y));↵ | 3 | Point point = control.toControl(new Point(event.x, event.y));↵ | |
4 | Rectangle bounds = tableItem.getBounds(0);↵ | 4 | Rectangle bounds = treeItem.getBounds();↵ | |
5 | return (float)(point.y - bounds.y) / (float)bounds.height; | 5 |
| |
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.0 |
Clones location | Clones are in the same method |
Number of node comparisons | 17 |
Number of mapped statements | 5 |
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) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8 | TableItem tableItem = (TableItem)event.item; |
| 2 | TreeItem treeItem = (TreeItem)event.item; | |||||||||||||||||||
9 | Control control = tableItem.getParent(); |
| 3 | Control control = treeItem.getParent(); | |||||||||||||||||||
10 | Point point = control.toControl(new Point(event.x, event.y)); | 4 | Point point = control.toControl(new Point(event.x, event.y)); | ||||||||||||||||||||
11 | Rectangle bounds = tableItem.getBounds(0); |
| 5 | Rectangle bounds = treeItem.getBounds(); | |||||||||||||||||||
12 | return (float)(point.y - bounds.y) / (float)bounds.height; | 6 | return (float)(point.y - bounds.y) / (float)bounds.height; |
Row | Violation |
---|---|
1 | Expression tableItem.getBounds(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression treeItem.getBounds() cannot be parameterized, because it has dependencies to/from statements that will be extracted |