File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Manifest.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/depend/AbstractAnalyzer.java | |||
Method name: void addConfiguredSection(Section)
|
Method name: void addRootClass(String)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 4 | |||
1 | String sectionName = section.getName();↵ | |||
2 | if (sectionName == null) {↵ | |||
3 | throw new BuildException("Sections must have a name");↵ | |||
4 | }↵ | |||
5 | sections.put(sectionName, section);↵ | |||
6 | if (!sectionIndex↵ | 1 | if (className == null) {↵ | |
2 | return;↵ | |||
3 | }↵ | |||
7 | .contains(sectionName)) {↵ | 4 | if (!rootClasses.contains(className)) {↵ | |
8 | sectionIndex.addElement(sectionName);↵ | 5 | rootClasses.addElement(className);↵ | |
9 | } | 6 |
| |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 13 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String sectionName = section.getName(); | | |||||||||||||||
2 | if (sectionName == null) |
| 1 | if (className == null) | |||||||||||||
|
| 2 | return; | ||||||||||||||
3 | throw new BuildException("Sections must have a name"); |
| | ||||||||||||||
4 | sections.put(sectionName, section); | | |||||||||||||||
5 | if (!sectionIndex.contains(sectionName)) |
| 3 | if (!rootClasses.contains(className)) | |||||||||||||
6 | sectionIndex.addElement(sectionName); |
| 4 | rootClasses.addElement(className); |
Row | Violation |
---|---|
1 | Unmatched return; |
2 | Unmatched throw new BuildException("Sections must have a name"); |