File path: /sql12/plugins/graph/src/net/sourceforge/squirrel_sql/plugins/graph/TableFrameController.java | File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/SQLAliasSchemaProperties.java | |||
Method name: ColumnInfo findColumnInfo(String)
|
Method name: SQLAliasSchemaDetailProperties getMatchingDetail(String, SQLAliasSchemaDetailProperties[])
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | for (int i = 0; i < _colInfos.length; i++)↵ | 1 | for (int i = 0; i < schemaDetails.length; i++)↵ | |
2 | {↵ | 2 | {↵ | |
3 | if(_colInfos[i].getName().equals(colName))↵ | 3 | if(schemaDetails[i].getSchemaName().equals(schemaName))↵ | |
4 | {↵ | 4 | {↵ | |
5 | return _colInfos[i];↵ | 5 | return schemaDetails[i];↵ | |
6 | }↵ | 6 | }↵ | |
7 | }↵ | 7 | }↵ | |
8 | throw new IllegalArgumentException("Column " + colName + " not found"); | 8 | return null; | |
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.4 |
Clones location | Clones are in different classes |
Number of node comparisons | 3 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.3 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | for (int i = 0; i < _colInfos.length; i++) |
| 1 | for (int i = 0; i < schemaDetails.length; i++) | ||||||||||||||
|
| 2 | if (schemaDetails[i].getSchemaName().equals(schemaName)) | |||||||||||||||
|
| 3 | return schemaDetails[i]; | |||||||||||||||
2 | if (_colInfos[i].getName().equals(colName)) |
| | |||||||||||||||
3 | return _colInfos[i]; |
| | |||||||||||||||
|
| 4 | return null; | |||||||||||||||
4 | throw new IllegalArgumentException("Column " + colName + " not found"); |
| |
Row | Violation |
---|---|
1 | Type int of variable _colInfos.length does not match with type int of variable schemaDetails.length |
2 | Unmatched statement if(schemaDetails[i].getSchemaName().equals(schemaName)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement return schemaDetails[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched return schemaDetails[i]; |
5 | Unmatched statement if(_colInfos[i].getName().equals(colName)) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement return _colInfos[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched return _colInfos[i]; |
8 | Unmatched return null; |
9 | Unmatched throw new IllegalArgumentException("Column " + colName + " not found"); |
10 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |