if(1 < _framesInOpeningSequence.size())
{
return _framesInOpeningSequence.get(0);
}
else
{
return sessionWindow;
}
if(1 < _framesInOpeningSequence.size())
{
return _framesInOpeningSequence.get(_framesInOpeningSequence.size() - 1);
}
else
{
return sessionWindow;
}
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/SessionWindowsHolder.java
|
|
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/SessionWindowsHolder.java
|
Method name: ISessionWidget getNextSessionWindow(ISessionWidget)
|
|
Method name: ISessionWidget getPreviousSessionWindow(ISessionWidget)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if(1 < _framesInOpeningSequence.size())↵ | | 1 | if(1 < _framesInOpeningSequence.size())↵
|
2 | {↵ | | 2 | {↵
|
3 | return _framesInOpeningSequence.get(0);↵ | | 3 | return _framesInOpeningSequence.get(_framesInOpeningSequence.size() - 1);↵
|
4 | }↵ | | 4 | }↵
|
5 | else↵ | | 5 | else↵
|
6 | {↵ | | 6 | {↵
|
7 | return sessionWindow;↵ | | 7 | return sessionWindow;↵
|
8 | } | | 8 | }
|
See real code fragment |
|
See real code fragment |
Summary
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 | 10 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
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) | 1.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | if (1 < _framesInOpeningSequence.size()) | | 4 | if (1 < _framesInOpeningSequence.size()) |
5 | return _framesInOpeningSequence.get(0); | | 5 | return _framesInOpeningSequence.get(_framesInOpeningSequence.size() - 1); |
| | | | |
6 | | | 6 | |
Precondition Violations (2)
Row |
Violation |
1 | Expression _framesInOpeningSequence.size() - 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Not all possible execution flows end in a return statement |