File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/ChunkCache.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/ChunkCache.java | |||
Method name: int getBelowPosition(int, int, int, boolean)
|
Method name: int getAbovePosition(int, int, int, boolean)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | if(subregion != lineInfos.length - 1 && !ignoreWrap)↵ | 1 | if(subregion != 0 && !ignoreWrap)↵ | |
2 | {↵ | 2 | {↵ | |
3 | return textArea.getLineStartOffset(physicalLine)↵ | 3 | return textArea.getLineStartOffset(physicalLine)↵ | |
4 | + xToSubregionOffset(lineInfos[subregion + 1],↵ | 4 | + xToSubregionOffset(lineInfos[subregion - 1],↵ | |
5 | x,true);↵ | 5 | x,true);↵ | |
6 | }↵ | 6 | }↵ | |
7 | else↵ | 7 | else↵ | |
8 | {↵ | 8 | {↵ | |
9 | int nextLine = textArea.displayManager↵ | 9 | int prevLine = textArea.displayManager↵ | |
10 | .getNextVisibleLine(physicalLine);↵ | 10 | .getPrevVisibleLine(physicalLine);↵ | |
11 | if(nextLine == -1)↵ | 11 | if(prevLine == -1)↵ | |
12 | return -1;↵ | 12 | return -1;↵ | |
13 | else↵ | 13 | else↵ | |
14 | {↵ | 14 | {↵ | |
15 | return textArea.getLineStartOffset(nextLine)↵ | 15 | return textArea.getLineStartOffset(prevLine)↵ | |
16 | + xToSubregionOffset(nextLine,0,↵ | 16 | + xToSubregionOffset(prevLine,-1,↵ | |
17 | x,true);↵ | 17 | x,true);↵ | |
18 | }↵ | 18 | }↵ | |
19 | } | 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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 18 |
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) | 8.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | if (subregion != lineInfos.length - 1 && !ignoreWrap) |
| 3 | if (subregion != 0 && !ignoreWrap) | ||||||||||||||||
|
| 4 | return textArea.getLineStartOffset(physicalLine) + xToSubregionOffset(lineInfos[subregion - 1], x, true); | |||||||||||||||||
4 | return textArea.getLineStartOffset(physicalLine) + xToSubregionOffset(lineInfos[subregion + 1], x, true); |
| | |||||||||||||||||
else | else | |||||||||||||||||||
5 | int nextLine = textArea.displayManager.getNextVisibleLine(physicalLine); |
| 5 | int prevLine = textArea.displayManager.getPrevVisibleLine(physicalLine); | ||||||||||||||||
6 | if (nextLine == -1) |
| 6 | if (prevLine == -1) | ||||||||||||||||
7 | return -1; | 7 | return -1; | |||||||||||||||||
else | else | |||||||||||||||||||
8 | return textArea.getLineStartOffset(nextLine) + xToSubregionOffset(nextLine, 0, x, true); |
| 8 | return textArea.getLineStartOffset(prevLine) + xToSubregionOffset(prevLine, -1, x, true); |
Row | Violation |
---|---|
1 | Unmatched statement return textArea.getLineStartOffset(physicalLine) + xToSubregionOffset(lineInfos[subregion - 1],x,true); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched return textArea.getLineStartOffset(physicalLine) + xToSubregionOffset(lineInfos[subregion - 1],x,true); |
3 | Unmatched statement return textArea.getLineStartOffset(physicalLine) + xToSubregionOffset(lineInfos[subregion + 1],x,true); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched return textArea.getLineStartOffset(physicalLine) + xToSubregionOffset(lineInfos[subregion + 1],x,true); |