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: 9 | Number of AST nodes: 9 | |||
1 | for (current = newMatch; current != null; current = current.next) {↵ | 1 | for (current = newMatch; current != null; current = current.next) {↵ | |
2 | recurrent↵ | 2 | // clone() separates a single match from the chain↵ | |
3 | = (REMatch) current.clone();↵ | 3 | single = (REMatch) current.clone();↵ | |
4 | if (token.match(input, recurrent)) {↵ | 4 | ↵ | |
5 | // add all items in current to doables array↵ | |||
6 | if (doables == null) {↵ | |||
7 | doables = recurrent;↵ | |||
8 | doablesLast = recurrent;↵ | |||
9 | } else {↵ | |||
10 | // Order these from longest to shortest↵ | |||
11 | // Start by assuming longest (more repeats)↵ | |||
12 | doablesLast.next = recurrent;↵ | |||
13 | }↵ | |||
14 | ↵ | 5 | if (next(input, single)) {↵ | |
6 | // chain results to doneIndex↵ | |||
7 | if (doneIndex == null) {↵ | |||
8 | doneIndex = single;↵ | |||
9 | doneIndexLast = single;↵ | |||
10 | } else {↵ | |||
11 | doneIndexLast.next = single;↵ | |||
12 | }↵ | |||
15 | // Find new doablesLast↵ | 13 | // Find new doneIndexLast↵ | |
16 | while (doablesLast.next != null) {↵ | 14 | while (doneIndexLast.next != null) {↵ | |
17 | doablesLast = doablesLast.next;↵ | 15 | doneIndexLast = doneIndexLast.next;↵ | |
18 | ↵ | 16 | }↵ | |
19 | }↵ | 17 | }↵ | |
20 | }↵ | 18 | ↵ | |
21 | } | 19 |
| |
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 | 38 |
Number of mapped statements | 9 |
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) | 66.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17 | for (current = newMatch; current != null; current = current.next) | 4 | for (current = newMatch; current != null; current = current.next) | |||||||||||||||||||||
18 | recurrent = (REMatch)current.clone(); |
| 5 | single = (REMatch)current.clone(); | ||||||||||||||||||||
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, current , while Clone fragment #2 returns variables doneIndex |