File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/HistoryTextField.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/HistoryTextField.java | |||
Method name: void doBackwardSearch()
|
Method name: void doForwardSearch()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | if(historyModel == null)↵ | 1 | if(historyModel == null)↵ | |
2 | return;↵ | 2 | return;↵ | |
3 | if(getSelectionEnd() != getDocument().getLength())↵ | 3 | if(getSelectionEnd() != getDocument().getLength())↵ | |
4 | {↵ | 4 | {↵ | |
5 | setCaretPosition(getDocument().getLength());↵ | 5 | setCaretPosition(getDocument().getLength());↵ | |
6 | }↵ | 6 | }↵ | |
7 | String text = getText().substring(0,getSelectionStart());↵ | 7 | String text = getText().substring(0,getSelectionStart());↵ | |
8 | if(text == null)↵ | 8 | if(text == null)↵ | |
9 | {↵ | 9 | {↵ | |
10 | historyPrevious();↵ | 10 | historyNext();↵ | |
11 | return;↵ | 11 | return;↵ | |
12 | } | 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) | 1.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 38 |
Number of mapped statements | 8 |
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) | 2.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (historyModel == null) | 1 | if (historyModel == null) | |||||||||||||
2 | return; |
| 2 | return; | ||||||||||||
3 | if (getSelectionEnd() != getDocument().getLength()) | 3 | if (getSelectionEnd() != getDocument().getLength()) | |||||||||||||
4 | setCaretPosition(getDocument().getLength()); | 4 | setCaretPosition(getDocument().getLength()); | |||||||||||||
5 | String text = getText().substring(0, getSelectionStart()); | 5 | String text = getText().substring(0, getSelectionStart()); | |||||||||||||
6 | if (text == null) | 6 | if (text == null) | |||||||||||||
7 | historyPrevious(); |
| 7 | historyNext(); | ||||||||||||
8 | return; |
| 8 | return; |
Row | Violation |
---|---|
1 | Conditional return; |
2 | Conditional return; |
3 | Expression historyPrevious() is a void method call, and thus it cannot be parameterized |
4 | Expression historyNext() is a void method call, and thus it cannot be parameterized |
5 | Conditional return; |
6 | Conditional return; |