File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/PrefixLines.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/StripLineComments.java | |||
Method name: void initialize()
|
Method name: void initialize()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 5 | |||
1 | Parameter[] params = getParameters();↵ | 1 | Parameter[] params = getParameters();↵ | |
2 | if (params != null) {↵ | 2 | if (params != null) {↵ | |
3 | for (int i = 0; i < params.length; i++) {↵ | 3 | for (int i = 0; i < params.length; i++) {↵ | |
4 | if (PREFIX_KEY.equals(params[i].getName())) {↵ | 4 | if (COMMENTS_KEY.equals(params[i].getType())) {↵ | |
5 | prefix = params[i].getValue();↵ | 5 | ↵ | |
6 | break;↵ | 6 | comments.addElement(params[i].getValue());↵ | |
7 | }↵ | 7 | }↵ | |
8 | }↵ | 8 | }↵ | |
9 | } | 9 |
| |
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 | 9 |
Number of mapped statements | 4 |
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) | 0.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Parameter[] params = getParameters(); | 1 | Parameter[] params = getParameters(); | ||||||||||||||||
2 | if (params != null) | 2 | if (params != null) | ||||||||||||||||
3 | for (int i = 0; i < params.length; i++) | 3 | for (int i = 0; i < params.length; i++) | ||||||||||||||||
4 | if (PREFIX_KEY.equals(params[i].getName())) |
| 4 | if (COMMENTS_KEY.equals(params[i].getType())) | |||||||||||||||
|
| 5 | comments.addElement(params[i].getValue()); | ||||||||||||||||
5 | prefix = params[i].getValue(); |
| | ||||||||||||||||
6 | break; |
| |
Row | Violation |
---|---|
1 | Expression params[i].getName() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression params[i].getType() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement comments.addElement(params[i].getValue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement prefix=params[i].getValue(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched break; |
6 | Clone fragment #1 returns variables params, i , while Clone fragment #2 returns variables params, i |