File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/filter/plugins/CopyMessageAction.java | File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/filter/plugins/MoveMessageAction.java | |||
Method name: ICommand getCommand(IFilterAction, IFolder, Object[])
|
Method name: ICommand getCommand(IFilterAction, IFolder, Object[])
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | String uid = filterAction.getUid();↵ | 1 | String uid = filterAction.getUid();↵ | |
2 | IMailbox destFolder = (IMailbox) FolderTreeModel.getInstance()↵ | 2 | IMailbox destFolder = (IMailbox) FolderTreeModel.getInstance()↵ | |
3 | .getFolder(uid);↵ | 3 | .getFolder(uid);↵ | |
4 | if (destFolder == null) {↵ | 4 | if (destFolder == null) {↵ | |
5 | JOptionPane↵ | 5 | JOptionPane↵ | |
6 | .showMessageDialog(↵ | 6 | .showMessageDialog(↵ | |
7 | FrameManager.getInstance()↵ | 7 | FrameManager.getInstance()↵ | |
8 | .getActiveFrame(),↵ | 8 | .getActiveFrame(),↵ | |
9 | "Unable to find destination folder, please correct the destination folder path for this filter");↵ | 9 | "Unable to find destination folder, please correct the destination folder path for this filter");↵ | |
10 | throw new Exception("File not found");↵ | 10 | throw new Exception("File not found");↵ | |
11 | }↵ | 11 | }↵ | |
12 | MailFolderCommandReference r = new MailFolderCommandReference(srcFolder,↵ | 12 | MailFolderCommandReference r = new MailFolderCommandReference(srcFolder,↵ | |
13 | destFolder, uids);↵ | 13 | destFolder, uids);↵ | |
14 | CopyMessageCommand c = new CopyMessageCommand(r);↵ | 14 | MoveMessageCommand c = new MoveMessageCommand(r);↵ | |
15 | return c; | 15 |
| |
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 21 |
Number of mapped statements | 8 |
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) | 1.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String uid = filterAction.getUid(); | 1 | String uid = filterAction.getUid(); | |||||||||||||||||||
2 | IMailbox destFolder = (IMailbox)FolderTreeModel.getInstance().getFolder(uid); | 2 | IMailbox destFolder = (IMailbox)FolderTreeModel.getInstance().getFolder(uid); | |||||||||||||||||||
3 | if (destFolder == null) | 3 | if (destFolder == null) | |||||||||||||||||||
4 | JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(), "Unable to find destination folder, please correct the destination folder path for this filter"); | 4 | JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(), "Unable to find destination folder, please correct the destination folder path for this filter"); | |||||||||||||||||||
5 | throw new Exception("File not found"); | 5 | throw new Exception("File not found"); | |||||||||||||||||||
6 | MailFolderCommandReference r = new MailFolderCommandReference(srcFolder, destFolder, uids); | 6 | MailFolderCommandReference r = new MailFolderCommandReference(srcFolder, destFolder, uids); | |||||||||||||||||||
7 | CopyMessageCommand c = new CopyMessageCommand(r); |
| 7 | MoveMessageCommand c = new MoveMessageCommand(r); | ||||||||||||||||||
8 | return c; |
| 8 | return c; |
Row | Violation |
---|---|
1 | Expression new CopyMessageCommand(r) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new MoveMessageCommand(r) cannot be parameterized, because it has dependencies to/from statements that will be extracted |