File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/DataValue.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/internal/DataValue.java | |||
Method name: boolean isValidName(String)
|
Method name: boolean isValidNCName(String)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | if (name.length() == 0)↵ | 1 | if (ncName.length() == 0)↵ | |
2 | return false;↵ | 2 | return false;↵ | |
3 | char ch = name.charAt(0);↵ | 3 | char ch = ncName.charAt(0);↵ | |
4 | if( isNameStart(ch) == false)↵ | 4 | if( isNCNameStart(ch) == false)↵ | |
5 | return false;↵ | 5 | return false;↵ | |
6 | for (int i = 1; i < name.length(); i++ ) {↵ | 6 | for (int i = 1; i < ncName.length(); i++ ) {↵ | |
7 | ch = name.charAt(i);↵ | 7 | ch = ncName.charAt(i);↵ | |
8 | if( isName( ch ) == false ){↵ | 8 | if( isNCName( ch ) == false ){↵ | |
9 | return false;↵ | 9 | return false;↵ | |
10 | }↵ | 10 | }↵ | |
11 | }↵ | 11 | }↵ | |
12 | return true; | 12 |
| |
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 | 25 |
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) | 1.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (name.length() == 0) |
| 1 | if (ncName.length() == 0) | ||||||||||||
2 | return false; | 2 | return false; | |||||||||||||
3 | char ch = name.charAt(0); |
| 3 | char ch = ncName.charAt(0); | ||||||||||||
4 | if (isNameStart(ch) == false) |
| 4 | if (isNCNameStart(ch) == false) | ||||||||||||
5 | return false; | 5 | return false; | |||||||||||||
6 | for (int i = 1; i < name.length(); i++) |
| 6 | for (int i = 1; i < ncName.length(); i++) | ||||||||||||
7 | ch = name.charAt(i); |
| 7 | ch = ncName.charAt(i); | ||||||||||||
8 | if (isName(ch) == false) |
| 8 | if (isNCName(ch) == false) | ||||||||||||
9 | return false; | 9 | return false; | |||||||||||||
10 | return true; | 10 | return true; |
Row | Violation |
---|---|
1 | Expression isNameStart(ch) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression isNCNameStart(ch) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression isName(ch) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression isNCName(ch) cannot be parameterized, because it has dependencies to/from statements that will be extracted |