File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/spam/spamassassin/SpamAssassinPlugin.java | File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/spam/spamassassin/SpamAssassinPlugin.java | |||
Method name: void trainMessageAsSpam(IMailbox, Object)
|
Method name: void trainMessageAsHam(IMailbox, Object)
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | InputStream rawMessageSource = mailbox.getMessageSourceStream(uid);↵ | 1 | InputStream rawMessageSource = mailbox.getMessageSourceStream(uid);↵ | |
2 | IPCHelper ipcHelper = new IPCHelper();↵ | 2 | IPCHelper ipcHelper = new IPCHelper();↵ | |
3 | LOG.info("creating process..");↵ | 3 | LOG.info("creating process..");↵ | |
4 | ↵ | 4 | ↵ | |
5 | // --no-rebuild option is deprecated in recent SpamAssassin versions↵ | 5 | // --no-rebuild option is deprecated in recent SpamAssassin versions↵ | |
6 | /*↵ | 6 | ↵ | |
7 | ipcHelper.executeCommand(ExternalToolsHelper.getSALearn()↵ | |||
8 | + " --no-rebuild --spam --single");↵ | |||
9 | */↵ | |||
10 | ↵ | |||
11 | ipcHelper.executeCommand(ExternalToolsHelper.getSALearn()↵ | 7 | ipcHelper.executeCommand(ExternalToolsHelper.getSALearn()↵ | |
12 | + " --no-sync --spam --single");↵ | 8 | + " --no-sync --ham --single");↵ | |
13 | ↵ | |||
14 | ↵ | |||
15 | LOG.info("sending to stdin..");↵ | 9 | LOG.info("sending to stdin..");↵ | |
16 | ipcHelper.send(rawMessageSource);↵ | 10 | ipcHelper.send(rawMessageSource);↵ | |
17 | int exitVal = ipcHelper.waitFor();↵ | 11 | int exitVal = ipcHelper.waitFor();↵ | |
18 | LOG.info("exitcode=" + exitVal);↵ | 12 | LOG.info("exitcode=" + exitVal);↵ | |
19 | LOG.info("retrieving output..");↵ | 13 | LOG.info("retrieving output..");↵ | |
20 | String result = ipcHelper.getOutputString();↵ | 14 | String result = ipcHelper.getOutputString();↵ | |
21 | LOG.info("output=" + result);↵ | 15 | LOG.info("output=" + result);↵ | |
22 | ipcHelper.waitForThreads(); | 16 |
| |
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 76 |
Number of mapped statements | 12 |
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | InputStream rawMessageSource = mailbox.getMessageSourceStream(uid); | 1 | InputStream rawMessageSource = mailbox.getMessageSourceStream(uid); | |||||||||||
2 | IPCHelper ipcHelper = new IPCHelper(); | 2 | IPCHelper ipcHelper = new IPCHelper(); | |||||||||||
3 | LOG.info("creating process.."); | 3 | LOG.info("creating process.."); | |||||||||||
4 | ipcHelper.executeCommand(ExternalToolsHelper.getSALearn() + " --no-sync --spam --single"); |
| 4 | ipcHelper.executeCommand(ExternalToolsHelper.getSALearn() + " --no-sync --ham --single"); | ||||||||||
5 | LOG.info("sending to stdin.."); | 5 | LOG.info("sending to stdin.."); | |||||||||||
6 | ipcHelper.send(rawMessageSource); | 6 | ipcHelper.send(rawMessageSource); | |||||||||||
7 | int exitVal = ipcHelper.waitFor(); | 7 | int exitVal = ipcHelper.waitFor(); | |||||||||||
8 | LOG.info("exitcode=" + exitVal); | 8 | LOG.info("exitcode=" + exitVal); | |||||||||||
9 | LOG.info("retrieving output.."); | 9 | LOG.info("retrieving output.."); | |||||||||||
10 | String result = ipcHelper.getOutputString(); | 10 | String result = ipcHelper.getOutputString(); | |||||||||||
11 | LOG.info("output=" + result); | 11 | LOG.info("output=" + result); | |||||||||||
12 | ipcHelper.waitForThreads(); | 12 | ipcHelper.waitForThreads(); |
Row | Violation |
---|