File path: /jEdit-4.2/src/org/gjt/sp/jedit/MiscUtilities.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/MiscUtilities.java | |||
Method name: String getLongestPrefix(List, boolean)
|
Method name: String getLongestPrefix(Object[], boolean)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | for(int i = 1; i < str.size(); i++)↵ | 1 | for(int i = 1; i < str.length; i++)↵ | |
2 | {↵ | 2 | {↵ | |
3 | s = str.get(i).toString();↵ | 3 | String s = str[i].toString();↵ | |
4 | if(prefixLength >= s.length())↵ | 4 | if(prefixLength >= s.length())↵ | |
5 | break loop;↵ | 5 | break loop;↵ | |
6 | if(!compareChars(s.charAt(prefixLength),ch,ignoreCase))↵ | 6 | if(!compareChars(s.charAt(prefixLength),ch,ignoreCase))↵ | |
7 | break loop;↵ | 7 | break loop;↵ | |
8 | } | 8 |
| |
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 declared in the same class |
Number of node comparisons | 19 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9 | for (int i = 1; i < str.size(); i++) |
| 9 | for (int i = 1; i < str.length; i++) | ||||||||||
|
| 10 | String s = str[i].toString(); | |||||||||||
10 | s = str.get(i).toString(); |
| | |||||||||||
11 | if (prefixLength >= s.length()) | 11 | if (prefixLength >= s.length()) | |||||||||||
12 | break loop; |
| 12 | break loop; | ||||||||||
13 | if (!compareChars(s.charAt(prefixLength), ch, ignoreCase)) | 13 | if (!compareChars(s.charAt(prefixLength), ch, ignoreCase)) | |||||||||||
14 | break loop; |
| 14 | break loop; |
Row | Violation |
---|---|
1 | Unmatched statement String s=str[i].toString(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement s=str.get(i).toString(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Statement break loop; without innermost loop |
4 | Statement break loop; without innermost loop |
5 | Statement break loop; without innermost loop |
6 | Statement break loop; without innermost loop |