File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/perforce/P4Fstat.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/perforce/P4Add.java | |||
Method name: void execute()
|
Method name: void execute()
|
|||
Number of AST nodes: 16 | Number of AST nodes: 14 | |||
1 | for (int i = 0; i < filesets.size(); i++) {↵ | 1 | for (int i = 0; i < filesets.size(); i++) {↵ | |
2 | FileSet fs = (FileSet) filesets.elementAt(i);↵ | 2 | FileSet fs = (FileSet) filesets.elementAt(i);↵ | |
3 | DirectoryScanner ds = fs.getDirectoryScanner(getProject());↵ | 3 | DirectoryScanner ds = fs.getDirectoryScanner(getProject());↵ | |
4 | String[] srcFiles = ds.getIncludedFiles();↵ | 4 | String[] srcFiles = ds.getIncludedFiles();↵ | |
5 | fileNum = srcFiles.length;↵ | |||
6 | if (srcFiles != null) {↵ | 5 | if (srcFiles != null) {↵ | |
7 | for (int j = 0; j < srcFiles.length; j++) {↵ | 6 | for (int j = 0; j < srcFiles.length; j++) {↵ | |
8 | File f = new File(ds.getBasedir(), srcFiles[j]);↵ | 7 | File f = new File(ds.getBasedir(), srcFiles[j]);↵ | |
9 | filelist.append(" ").append('"').append(f.getAbsolutePath()).append('"');↵ | 8 | filelist.append(" ").append('"').append(f.getAbsolutePath()).append('"');↵ | |
10 | doneFileNum++;↵ | |||
11 | if (filelist.length() > cmdLength) {↵ | 9 | if (filelist.length() > cmdLength) {↵ | |
12 | execP4Fstat(filelist);↵ | 10 | execP4Add(filelist);↵ | |
13 | filelist = new StringBuffer();↵ | 11 | filelist = new StringBuffer();↵ | |
14 | }↵ | 12 | }↵ | |
15 | }↵ | 13 | }↵ | |
16 | if (filelist.length() > 0) {↵ | 14 | if (filelist.length() > 0) {↵ | |
17 | execP4Fstat(filelist);↵ | 15 | execP4Add(filelist);↵ | |
18 | }↵ | 16 | }↵ | |
19 | } else {↵ | 17 | } else {↵ | |
20 | log("No files specified to query status on!", Project.MSG_WARN);↵ | 18 | log("No files specified to add!", Project.MSG_WARN);↵ | |
21 | }↵ | 19 | }↵ | |
22 | } | 20 |
| |
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.6 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 50 |
Number of mapped statements | 14 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6 | for (int i = 0; i < filesets.size(); i++) | 5 | for (int i = 0; i < filesets.size(); i++) | |||||||||||||||
7 | FileSet fs = (FileSet)filesets.elementAt(i); | 6 | FileSet fs = (FileSet)filesets.elementAt(i); | |||||||||||||||
8 | DirectoryScanner ds = fs.getDirectoryScanner(getProject()); | 7 | DirectoryScanner ds = fs.getDirectoryScanner(getProject()); | |||||||||||||||
9 | String[] srcFiles = ds.getIncludedFiles(); | 8 | String[] srcFiles = ds.getIncludedFiles(); | |||||||||||||||
10 | fileNum = srcFiles.length; |
| | |||||||||||||||
11 | if (srcFiles != null) | 9 | if (srcFiles != null) | |||||||||||||||
12 | for (int j = 0; j < srcFiles.length; j++) | 10 | for (int j = 0; j < srcFiles.length; j++) | |||||||||||||||
13 | File f = new File(ds.getBasedir(), srcFiles[j]); | 11 | File f = new File(ds.getBasedir(), srcFiles[j]); | |||||||||||||||
14 | filelist.append(" ").append('"').append(f.getAbsolutePath()).append('"'); | 12 | filelist.append(" ").append('"').append(f.getAbsolutePath()).append('"'); | |||||||||||||||
15 | doneFileNum++; |
| | |||||||||||||||
16 | if (filelist.length() > cmdLength) | 13 | if (filelist.length() > cmdLength) | |||||||||||||||
17 | execP4Fstat(filelist); |
| 14 | execP4Add(filelist); | ||||||||||||||
18 | filelist = new StringBuffer(); | 15 | filelist = new StringBuffer(); | |||||||||||||||
19 | if (filelist.length() > 0) | 16 | if (filelist.length() > 0) | |||||||||||||||
20 | execP4Fstat(filelist); |
| 17 | execP4Add(filelist); | ||||||||||||||
else | else | |||||||||||||||||
21 | log("No files specified to query status on!", Project.MSG_WARN); |
| 18 | log("No files specified to add!", Project.MSG_WARN); |
Row | Violation |
---|---|
1 | Unmatched statement fileNum=srcFiles.length; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement doneFileNum++; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Expression execP4Fstat(filelist) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression execP4Add(filelist) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression execP4Fstat(filelist) is a void method call, and thus it cannot be parameterized |
6 | Expression execP4Add(filelist) is a void method call, and thus it cannot be parameterized |
7 | Expression execP4Fstat(filelist) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression execP4Add(filelist) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression execP4Fstat(filelist) is a void method call, and thus it cannot be parameterized |
10 | Expression execP4Add(filelist) is a void method call, and thus it cannot be parameterized |
11 | Clone fragment #1 returns variables srcFiles , while Clone fragment #2 returns variables |