File path: /apache-ant-1.7.0/src/org/apache/tools/ant/DirectoryScanner.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/net/FTP.java | |||
Method name: void checkIncludePatterns()
|
Method name: void checkIncludePatterns()
|
|||
Number of AST nodes: 10 | Number of AST nodes: 11 | |||
1 | if (myfile.isDirectory()) {↵ | 1 | if (myfile.isDirectory()) {↵ | |
2 | if (isIncluded(currentelement)↵ | 2 | if (isIncluded(currentelement)↵ | |
3 | && currentelement.length() > 0) {↵ | 3 | && currentelement.length() > 0) {↵ | |
4 | accountForIncludedDir(currentelement, myfile, true);↵ | 4 | accountForIncludedDir(currentelement, myfile, true);↵ | |
5 | } else {↵ | 5 | } else {↵ | |
6 | if (currentelement.length() > 0) {↵ | 6 | if (currentelement.length() > 0) {↵ | |
7 | if (currentelement.charAt(currentelement↵ | 7 | if (currentelement.charAt(currentelement↵ | |
8 | .length() - 1)↵ | 8 | .length() - 1)↵ | |
9 | != File.separatorChar) {↵ | 9 | != File.separatorChar) {↵ | |
10 | currentelement =↵ | 10 | currentelement =↵ | |
11 | currentelement + File.separatorChar;↵ | 11 | currentelement + File.separatorChar;↵ | |
12 | }↵ | 12 | ↵ | |
13 | }↵ | |||
13 | }↵ | 14 | }↵ | |
14 | scandir(myfile, currentelement, true);↵ | 15 | scandir(myfile.getAbsolutePath(), currentelement, true);↵ | |
15 | }↵ | 16 | }↵ | |
16 | } else {↵ | 17 | } else {↵ | |
17 | boolean included = isCaseSensitive()↵ | 18 | if (isCaseSensitive↵ | |
18 | ? originalpattern.equals(currentelement)↵ | 19 | && originalpattern.equals(currentelement)) {↵ | |
19 | : originalpattern.equalsIgnoreCase(currentelement);↵ | 20 | accountForIncludedFile(currentelement);↵ | |
20 | if (included) {↵ | 21 | ↵ | |
22 | } else if (!isCaseSensitive↵ | |||
23 | && originalpattern↵ | |||
24 | .equalsIgnoreCase(currentelement)) {↵ | |||
21 | accountForIncludedFile(currentelement, myfile);↵ | 25 | accountForIncludedFile(currentelement);↵ | |
22 | }↵ | 26 | ↵ | |
27 | }↵ | |||
23 | } | 28 | } | |
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) | 1.5 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 23 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 105.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
38 | if (myfile.isDirectory()) |
| 32 | if (myfile.isDirectory()) | |||||||||||
39 | if (isIncluded(currentelement) && currentelement.length() > 0) | 33 | if (isIncluded(currentelement) && currentelement.length() > 0) | ||||||||||||
40 | accountForIncludedDir(currentelement, myfile, true); |
| 34 | accountForIncludedDir(currentelement, myfile, true); | |||||||||||
else | else | ||||||||||||||
41 | if (currentelement.length() > 0) | 35 | if (currentelement.length() > 0) | ||||||||||||
42 | if (currentelement.charAt(currentelement.length() - 1) != File.separatorChar) | 36 | if (currentelement.charAt(currentelement.length() - 1) != File.separatorChar) | ||||||||||||
43 | currentelement = currentelement + File.separatorChar; | 37 | currentelement = currentelement + File.separatorChar; | ||||||||||||
|
| 38 | scandir(myfile.getAbsolutePath(), currentelement, true); | ||||||||||||
44 | scandir(myfile, currentelement, true); |
| | ||||||||||||
else | | ||||||||||||||
45 | boolean included = isCaseSensitive() ? originalpattern.equals(currentelement) : originalpattern.equalsIgnoreCase(currentelement); | |
Row | Violation |
---|---|
1 | Type java.io.File of variable myfile does not match with type org.apache.tools.ant.taskdefs.optional.net.FTP.FTPDirectoryScanner.AntFTPFile of variable myfile |
2 | Type java.io.File of variable myfile does not match with type org.apache.tools.ant.taskdefs.optional.net.FTP.FTPDirectoryScanner.AntFTPFile of variable myfile |
3 | Unmatched statement scandir(myfile.getAbsolutePath(),currentelement,true); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement scandir(myfile,currentelement,true); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |