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