File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/vss/MSVSSTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/vss/MSVSSTest.java | |||
Method name: void testLabelCommandLine1()
|
Method name: void testAddCommandLine()
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | String[] sTestCmdLine = {MSVSS.SS_EXE, MSVSS.COMMAND_LABEL, DS_VSS_PROJECT_PATH,↵ | 1 | String[] sTestCmdLine = {SS_DIR + File.separator + MSVSS.SS_EXE, MSVSS.COMMAND_↵ | |
2 | MSVSS.FLAG_COMMENT + SRC_COMMENT, MSVSS.FLAG_AUTORESPONSE_YES↵ | 2 | ADD,↵ | |
3 | ,↵ | 3 | project.getBaseDir().getAbsolutePath() + File.separator + LOCAL_PATH,↵ | |
4 | MSVSS.FLAG_LABEL + SRC_LABEL, MSVSS.FLAG_VERSION + VERSION, MSVSS.FLAG_LOGIN↵ | 4 | MSVSS.FLAG_AUTORESPONSE_DEF, MSVSS.FLAG_RECURSION,↵ | |
5 | + VSS_USERNAME + "," + VSS_PASSWORD};↵ | 5 | MSVSS.FLAG_LOGIN + VSS_USERNAME + "," + VSS_PASSWORD, MSVSS.FLAG_COMMENT + "-"};↵ | |
6 | // Set up a VSSLabel task↵ | 6 | // Set up a VSSAdd task↵ | |
7 | MSVSSLABEL vssLabel = new MSVSSLABEL();↵ | 7 | MSVSSADD vssAdd = new MSVSSADD();↵ | |
8 | vssLabel.setProject(project);↵ | 8 | vssAdd.setProject(project);↵ | |
9 | vssLabel.setComment(SRC_COMMENT);↵ | 9 | vss↵ | |
10 | vssLabel.setLogin(VSS_USERNAME + "," + VSS_PASSWORD);↵ | 10 | Add.setLogin(VSS_USERNAME + "," + VSS_PASSWORD);↵ | |
11 | vssLabel.setVersion(VERSION);↵ | 11 | vssAdd.setVsspath(DS_VSS_PROJECT_PATH);↵ | |
12 | vssLabel.setAutoresponse("Y");↵ | 12 | vss↵ | |
13 | vssLabel.setLabel(SRC_LABEL↵ | 13 | Add.setRecursive(true);↵ | |
14 | );↵ | 14 | vssAdd.setSsdir(SS_DIR);↵ | |
15 | vssLabel.setVsspath(VSS_PROJECT↵ | 15 | vssAdd.setWritable(false);↵ | |
16 | _PATH);↵ | 16 | vssAdd.setLocalpath(new Path(project, LOCAL_PATH));↵ | |
17 | commandline = vssLabel.buildCmdLine();↵ | 17 | commandline = vssAdd.buildCmdLine();↵ | |
18 | checkCommandLines(sTestCmdLine, commandline.getCommandline()); | 18 |
| |
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 declared in the same class |
Number of node comparisons | 89 |
Number of mapped statements | 8 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | String[] sTestCmdLine = {SS_DIR + File.separator + MSVSS.SS_EXE, MSVSS.COMMAND_ADD, project.getBaseDir().getAbsolutePath() + File.separator + LOCAL_PATH, MSVSS.FLAG_AUTORESPONSE_DEF, MSVSS.FLAG_RECURSION, MSVSS.FLAG_LOGIN + VSS_USERNAME + "," + VSS_PASSWORD, MSVSS.FLAG_COMMENT + "-"}; | ||||||||||||||||||||||||||
1 | String[] sTestCmdLine = {MSVSS.SS_EXE, MSVSS.COMMAND_LABEL, DS_VSS_PROJECT_PATH, MSVSS.FLAG_COMMENT + SRC_COMMENT, MSVSS.FLAG_AUTORESPONSE_YES, MSVSS.FLAG_LABEL + SRC_LABEL, MSVSS.FLAG_VERSION + VERSION, MSVSS.FLAG_LOGIN + VSS_USERNAME + "," + VSS_PASSWORD}; | | ||||||||||||||||||||||||||
2 | MSVSSLABEL vssLabel = new MSVSSLABEL(); |
| 2 | MSVSSADD vssAdd = new MSVSSADD(); | ||||||||||||||||||||||||
3 | vssLabel.setProject(project); |
| 3 | vssAdd.setProject(project); | ||||||||||||||||||||||||
4 | vssLabel.setComment(SRC_COMMENT); |
| 5 | vssAdd.setVsspath(DS_VSS_PROJECT_PATH); | ||||||||||||||||||||||||
5 | vssLabel.setLogin(VSS_USERNAME + "," + VSS_PASSWORD); |
| 4 | vssAdd.setLogin(VSS_USERNAME + "," + VSS_PASSWORD); | ||||||||||||||||||||||||
| 6 | vssAdd.setRecursive(true); | ||||||||||||||||||||||||||
6 | vssLabel.setVersion(VERSION); |
| 7 | vssAdd.setSsdir(SS_DIR); | ||||||||||||||||||||||||
| 8 | vssAdd.setWritable(false); | ||||||||||||||||||||||||||
7 | vssLabel.setAutoresponse("Y"); |
| 11 | checkCommandLines(sTestCmdLine, commandline.getCommandline()); | ||||||||||||||||||||||||
8 | vssLabel.setLabel(SRC_LABEL); | | ||||||||||||||||||||||||||
9 | vssLabel.setVsspath(VSS_PROJECT_PATH); | | ||||||||||||||||||||||||||
10 | commandline = vssLabel.buildCmdLine(); |
| 10 | commandline = vssAdd.buildCmdLine(); | ||||||||||||||||||||||||
11 | checkCommandLines(sTestCmdLine, commandline.getCommandline()); |
| 9 | vssAdd.setLocalpath(new Path(project, LOCAL_PATH)); |
Row | Violation |
---|---|
1 | Expression vssLabel.setComment(SRC_COMMENT) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression vssAdd.setVsspath(DS_VSS_PROJECT_PATH) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression vssLabel.setComment(SRC_COMMENT) is a void method call, and thus it cannot be parameterized |
4 | Expression vssAdd.setVsspath(DS_VSS_PROJECT_PATH) is a void method call, and thus it cannot be parameterized |
5 | Expression vssLabel.setVersion(VERSION) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression vssAdd.setSsdir(SS_DIR) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression vssLabel.setVersion(VERSION) is a void method call, and thus it cannot be parameterized |
8 | Expression vssAdd.setSsdir(SS_DIR) is a void method call, and thus it cannot be parameterized |
9 | Expression vssLabel.setAutoresponse("Y") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression vssLabel.setAutoresponse("Y") is a void method call, and thus it cannot be parameterized |
12 | Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) is a void method call, and thus it cannot be parameterized |
13 | Expression vssLabel.setAutoresponse("Y") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Expression vssLabel.setAutoresponse("Y") is a void method call, and thus it cannot be parameterized |
16 | Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) is a void method call, and thus it cannot be parameterized |
17 | Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
18 | Expression vssAdd.setLocalpath(new Path(project,LOCAL_PATH)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
19 | Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) is a void method call, and thus it cannot be parameterized |
20 | Expression vssAdd.setLocalpath(new Path(project,LOCAL_PATH)) is a void method call, and thus it cannot be parameterized |
21 | Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
22 | Expression vssAdd.setLocalpath(new Path(project,LOCAL_PATH)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
23 | Expression checkCommandLines(sTestCmdLine,commandline.getCommandline()) is a void method call, and thus it cannot be parameterized |
24 | Expression vssAdd.setLocalpath(new Path(project,LOCAL_PATH)) is a void method call, and thus it cannot be parameterized |
25 | Clone fragment #1 returns variable vssLabel with type org.apache.tools.ant.taskdefs.optional.vss.MSVSSLABEL , while Clone fragment #2 returns variable vssAdd with type org.apache.tools.ant.taskdefs.optional.vss.MSVSSADD |