File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/tagging/TagList.java | File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/search/ResultList.java | |||
Method name: void handlePopupEvent(MouseEvent)
|
Method name: void handlePopupEvent(MouseEvent)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | Point p = e.getPoint();↵ | 1 | Point p = e.getPoint();↵ | |
2 | if (e.isPopupTrigger()) {↵ | 2 | if (e.isPopupTrigger()) {↵ | |
3 | // check if a single entry is selected↵ | 3 | // check if a single entry is selected↵ | |
4 | if (getSelectedIndices().length <= 1) {↵ | 4 | if (getSelectedIndices().length <= 1) {↵ | |
5 | // select new item↵ | 5 | // select new item↵ | |
6 | int index = locationToIndex(p);↵ | 6 | int index = locationToIndex(p);↵ | |
7 | setSelectedIndex(index);↵ | 7 | setSelectedIndex(index);↵ | |
8 | }↵ | 8 | }↵ | |
9 | // show context menu↵ | 9 | // show context menu↵ | |
10 | popup.show(e.getComponent(), p.x, p.y);↵ | 10 | getPopupMenu().show(e.getComponent(), p.x, p.y);↵ | |
11 | } | 11 |
| |
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 having the same super class |
Number of node comparisons | 14 |
Number of mapped statements | 6 |
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) | 2.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Point p = e.getPoint(); | 1 | Point p = e.getPoint(); | ||||||||||||
2 | if (e.isPopupTrigger()) | 2 | if (e.isPopupTrigger()) | ||||||||||||
3 | if (getSelectedIndices().length <= 1) | 3 | if (getSelectedIndices().length <= 1) | ||||||||||||
4 | int index = locationToIndex(p); | 4 | int index = locationToIndex(p); | ||||||||||||
5 | setSelectedIndex(index); | 5 | setSelectedIndex(index); | ||||||||||||
6 | popup.show(e.getComponent(), p.x, p.y); |
| 6 | getPopupMenu().show(e.getComponent(), p.x, p.y); |
Row | Violation |
---|---|
1 | Expression getPopupMenu() cannot be parameterized, because it has dependencies to/from statements that will be extracted |