File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/sos/SOSCheckin.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/sos/SOSCheckout.java | |||
Method name: Commandline buildCmdLine()
|
Method name: Commandline buildCmdLine()
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | commandLine = new Commandline();↵ | 1 | commandLine = new Commandline();↵ | |
2 | // If we find a "file" attribute then act on a file otherwise act on a project↵ | 2 | // If we find a "file" attribute then act on a file otherwise act on a project↵ | |
3 | if (getFilename() != null) {↵ | 3 | if (getFilename() != null) {↵ | |
4 | // add -command CheckInFile to the commandline↵ | 4 | // add -command CheckOutFile to the commandline↵ | |
5 | commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND);↵ | 5 | commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND);↵ | |
6 | commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKIN_FILE);↵ | 6 | commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKOUT_FILE);↵ | |
7 | // add -file xxxxx to the commandline↵ | 7 | // add -file xxxxx to the commandline↵ | |
8 | commandLine.createArgument().setValue(SOSCmd.FLAG_FILE);↵ | 8 | commandLine.createArgument().setValue(SOSCmd.FLAG_FILE);↵ | |
9 | commandLine.createArgument().setValue(getFilename());↵ | 9 | commandLine.createArgument().setValue(getFilename());↵ | |
10 | } else {↵ | 10 | } else {↵ | |
11 | // add -command CheckInProject to the commandline↵ | 11 | // add -command CheckOutProject to the commandline↵ | |
12 | commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND);↵ | 12 | commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND);↵ | |
13 | commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKIN_PROJECT);↵ | 13 | commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKOUT_PROJECT);↵ | |
14 | // look for a recursive option↵ | 14 | // look for a recursive option↵ | |
15 | commandLine.createArgument().setValue(getRecursive());↵ | 15 | commandLine.createArgument().setValue(getRecursive());↵ | |
16 | }↵ | 16 | }↵ | |
17 | getRequiredAttributes();↵ | 17 | getRequiredAttributes();↵ | |
18 | getOptionalAttributes(); | 18 |
| |
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 69 |
Number of mapped statements | 11 |
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) | 8.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | commandLine = new Commandline(); | 1 | commandLine = new Commandline(); | |||||||||||
2 | if (getFilename() != null) | 2 | if (getFilename() != null) | |||||||||||
3 | commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND); | 3 | commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND); | |||||||||||
4 | commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKIN_FILE); |
| 4 | commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKOUT_FILE); | ||||||||||
5 | commandLine.createArgument().setValue(SOSCmd.FLAG_FILE); | 5 | commandLine.createArgument().setValue(SOSCmd.FLAG_FILE); | |||||||||||
6 | commandLine.createArgument().setValue(getFilename()); | 6 | commandLine.createArgument().setValue(getFilename()); | |||||||||||
else | else | |||||||||||||
7 | commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND); | 7 | commandLine.createArgument().setValue(SOSCmd.FLAG_COMMAND); | |||||||||||
8 | commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKIN_PROJECT); |
| 8 | commandLine.createArgument().setValue(SOSCmd.COMMAND_CHECKOUT_PROJECT); | ||||||||||
9 | commandLine.createArgument().setValue(getRecursive()); | 9 | commandLine.createArgument().setValue(getRecursive()); | |||||||||||
10 | getRequiredAttributes(); | 10 | getRequiredAttributes(); | |||||||||||
11 | getOptionalAttributes(); | 11 | getOptionalAttributes(); |
Row | Violation |
---|