File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/SelectorUtils.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/SelectorUtils.java | |||
Method name: boolean match(String, String, boolean)
|
Method name: boolean match(String, String, boolean)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | if (ch != '?') {↵ | 1 | if (ch != '?') {↵ | |
2 | if (isCaseSensitive && ch != strArr[strIdxStart]) {↵ | 2 | if (isCaseSensitive && ch != strArr[strIdxEnd]) {↵ | |
3 | return false; // Character mismatch↵ | 3 | return false; // Character mismatch↵ | |
4 | }↵ | 4 | }↵ | |
5 | if (!isCaseSensitive && Character.toUpperCase(ch)↵ | 5 | if (!isCaseSensitive && Character.toUpperCase(ch)↵ | |
6 | != Character.toUpperCase(strArr[strIdxStart])) {↵ | 6 | != Character.toUpperCase(strArr[strIdxEnd])) {↵ | |
7 | return false; // Character mismatch↵ | 7 | return false; // Character mismatch↵ | |
8 | }↵ | 8 | }↵ | |
9 | }↵ | 9 | }↵ | |
10 | patIdxStart++;↵ | 10 | patIdxEnd--;↵ | |
11 | strIdxStart++; | 11 | strIdxEnd--; | |
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) | 2.4 |
Clones location | Clones are in the same method |
Number of node comparisons | 19 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 2.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
27 | if (ch != '?') | 40 | if (ch != '?') | |||||||||||
28 | if (isCaseSensitive && ch != strArr[strIdxStart]) |
| 41 | if (isCaseSensitive && ch != strArr[strIdxEnd]) | ||||||||||
29 | return false; |
| 42 | return false; | ||||||||||
30 | if (!isCaseSensitive && Character.toUpperCase(ch) != Character.toUpperCase(strArr[strIdxStart])) |
| 43 | if (!isCaseSensitive && Character.toUpperCase(ch) != Character.toUpperCase(strArr[strIdxEnd])) | ||||||||||
31 | return false; |
| 44 | return false; | ||||||||||
32 | patIdxStart++; | | ||||||||||||
33 | strIdxStart++; |
| | |||||||||||
| 45 | patIdxEnd--; | ||||||||||||
|
| 46 | strIdxEnd--; |
Row | Violation |
---|---|
1 | Unmatched statement strIdxStart++; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement strIdxEnd--; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Conditional return false; |
4 | Conditional return false; |
5 | Conditional return false; |
6 | Conditional return false; |