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