File path: /jEdit-4.2/src/bsh/NameSpace.java | File path: /jEdit-4.2/src/bsh/NameSpace.java | |||
Method name: SimpleNode getNode()
|
Method name: String getPackage()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | if ( callerInfoNode != null )↵ | 1 | if ( packageName != null )↵ | |
2 | return callerInfoNode;↵ | 2 | return packageName;↵ | |
3 | if ( parent != null )↵ | 3 | if ( parent != null )↵ | |
4 | return parent.getNode();↵ | 4 | return parent.getPackage();↵ | |
5 | else↵ | 5 | ↵ | |
6 | ↵ | |||
7 | return null; | 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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 15 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (callerInfoNode != null) |
| 1 | if (packageName != null) | ||||||||||||||
|
| 2 | return packageName; | |||||||||||||||
2 | return callerInfoNode; |
| | |||||||||||||||
3 | if (parent != null) | 3 | if (parent != null) | |||||||||||||||
|
| 4 | return parent.getPackage(); | |||||||||||||||
4 | return parent.getNode(); |
| | |||||||||||||||
else | | |||||||||||||||||
5 | return null; |
| | |||||||||||||||
|
| 5 | return null; |
Row | Violation |
---|---|
1 | Type bsh.SimpleNode of variable callerInfoNode does not match with type java.lang.String of variable packageName |
2 | Unmatched return packageName; |
3 | Unmatched return callerInfoNode; |
4 | Unmatched statement return parent.getPackage(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Unmatched return parent.getPackage(); |
6 | Unmatched statement return parent.getNode(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
7 | Unmatched return parent.getNode(); |
8 | Unmatched return null; |
9 | Unmatched return null; |