File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/ContainsSelector.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/FilenameSelector.java | |||
Method name: void setParameters(Parameter[])
|
Method name: void setParameters(Parameter[])
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | if (parameters != null) {↵ | 1 | if (parameters != null) {↵ | |
2 | for (int i = 0; i < parameters.length; i++) {↵ | 2 | for (int i = 0; i < parameters.length; i++) {↵ | |
3 | String paramname = parameters[i].getName();↵ | 3 | String paramname = parameters[i].getName();↵ | |
4 | if (CONTAINS_KEY.equalsIgnoreCase(paramname)) {↵ | 4 | if (NAME_KEY.equalsIgnoreCase(paramname)) {↵ | |
5 | setText(parameters[i].getValue());↵ | 5 | setName(parameters[i].getValue());↵ | |
6 | } else if (CASE_KEY.equalsIgnoreCase(paramname)) {↵ | 6 | } else if (CASE_KEY.equalsIgnoreCase(paramname)) {↵ | |
7 | setCasesensitive(Project.toBoolean(↵ | 7 | setCasesensitive(Project.toBoolean(↵ | |
8 | parameters[i].getValue()));↵ | 8 | parameters[i].getValue()));↵ | |
9 | } else if (WHITESPACE_KEY.equalsIgnoreCase(paramname)) {↵ | 9 | } else if (NEGATE_KEY.equalsIgnoreCase(paramname)) {↵ | |
10 | setIgnorewhitespace(Project.toBoolean(↵ | 10 | setNegate(Project.toBoolean(↵ | |
11 | parameters[i].getValue()));↵ | 11 | parameters[i].getValue()));↵ | |
12 | } else {↵ | 12 | } else {↵ | |
13 | setError("Invalid parameter " + paramname);↵ | 13 | setError("Invalid parameter " + paramname);↵ | |
14 | }↵ | 14 | }↵ | |
15 | }↵ | 15 | }↵ | |
16 | } | 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.6 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 41 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | if (parameters != null) | 2 | if (parameters != null) | |||||||||||||||
3 | for (int i = 0; i < parameters.length; i++) | 3 | for (int i = 0; i < parameters.length; i++) | |||||||||||||||
4 | String paramname = parameters[i].getName(); | 4 | String paramname = parameters[i].getName(); | |||||||||||||||
5 | if (CONTAINS_KEY.equalsIgnoreCase(paramname)) |
| 5 | if (NAME_KEY.equalsIgnoreCase(paramname)) | ||||||||||||||
6 | setText(parameters[i].getValue()); |
| 6 | setName(parameters[i].getValue()); | ||||||||||||||
7 | else if (CASE_KEY.equalsIgnoreCase(paramname)) | 7 | else if (CASE_KEY.equalsIgnoreCase(paramname)) | |||||||||||||||
8 | setCasesensitive(Project.toBoolean(parameters[i].getValue())); | 8 | setCasesensitive(Project.toBoolean(parameters[i].getValue())); | |||||||||||||||
9 | else if (WHITESPACE_KEY.equalsIgnoreCase(paramname)) |
| 9 | else if (NEGATE_KEY.equalsIgnoreCase(paramname)) | ||||||||||||||
10 | setIgnorewhitespace(Project.toBoolean(parameters[i].getValue())); |
| 10 | setNegate(Project.toBoolean(parameters[i].getValue())); | ||||||||||||||
else | else | |||||||||||||||||
11 | setError("Invalid parameter " + paramname); | 11 | setError("Invalid parameter " + paramname); |
Row | Violation |
---|---|
1 | Expression setText(parameters[i].getValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression setName(parameters[i].getValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression setText(parameters[i].getValue()) is a void method call, and thus it cannot be parameterized |
4 | Expression setName(parameters[i].getValue()) is a void method call, and thus it cannot be parameterized |
5 | Expression setIgnorewhitespace(Project.toBoolean(parameters[i].getValue())) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression setNegate(Project.toBoolean(parameters[i].getValue())) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression setIgnorewhitespace(Project.toBoolean(parameters[i].getValue())) is a void method call, and thus it cannot be parameterized |
8 | Expression setNegate(Project.toBoolean(parameters[i].getValue())) is a void method call, and thus it cannot be parameterized |