File path: /jEdit-4.2/src/gnu/regexp/RETokenRepeated.java | File path: /jEdit-4.2/src/gnu/regexp/RETokenRepeated.java | |||
Method name: REMatch matchRest(CharIndexed, REMatch)
|
Method name: boolean match(CharIndexed, REMatch)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | if (next(input, single)) {↵ | 1 | if (↵ | |
2 | // chain results to doneIndex↵ | |||
3 | if (doneIndex == null) {↵ | |||
4 | doneIndex = single;↵ | |||
5 | doneIndexLast = single;↵ | |||
6 | } else {↵ | |||
7 | doneIndexLast.next = single;↵ | |||
8 | }↵ | |||
9 | ↵ | 2 | token.match(input, recurrent)) {↵ | |
3 | // add all items in current to doables array↵ | |||
4 | if (doables == null) {↵ | |||
5 | doables = recurrent;↵ | |||
6 | doablesLast = recurrent;↵ | |||
7 | } else {↵ | |||
8 | // Order these from longest to shortest↵ | |||
9 | // Start by assuming longest (more repeats)↵ | |||
10 | doablesLast.next = recurrent;↵ | |||
11 | }↵ | |||
10 | // Find new doneIndexLast↵ | 12 | // Find new doablesLast↵ | |
11 | while (doneIndexLast.next != null) {↵ | 13 | while (doablesLast.next != null) {↵ | |
12 | doneIndexLast = doneIndexLast.next;↵ | 14 | doablesLast = doablesLast.next;↵ | |
13 | }↵ | 15 | ↵ | |
14 | } | 16 | }↵ | |
17 |
| |||
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.9 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 28 |
Number of mapped statements | 7 |
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) | 132.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6 | if (next(input, single)) |
| 19 | if (token.match(input, recurrent)) | ||||||||||||||||||||
7 | if (doneIndex == null) |
| 20 | if (doables == null) | ||||||||||||||||||||
8 | doneIndex = single; |
| 21 | doables = recurrent; | ||||||||||||||||||||
9 | doneIndexLast = single; |
| 22 | doablesLast = recurrent; | ||||||||||||||||||||
else | else | |||||||||||||||||||||||
10 | doneIndexLast.next = single; |
| 23 | doablesLast.next = recurrent; | ||||||||||||||||||||
11 | while (doneIndexLast.next != null) |
| 24 | while (doablesLast.next != null) | ||||||||||||||||||||
12 | doneIndexLast = doneIndexLast.next; |
| 25 | doablesLast = doablesLast.next; |
Row | Violation |
---|---|
1 | Expression next(input,single) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression token.match(input,recurrent) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression next(input,single) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression token.match(input,recurrent) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression doneIndexLast.next cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression doablesLast.next cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression doneIndexLast.next cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression doablesLast.next cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression doneIndexLast.next cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression doablesLast.next cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Clone fragment #1 returns variables doneIndex, doneIndexLast , while Clone fragment #2 returns variables doables, doablesLast |