File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/ColumnListDialog.java | File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/SQLAliasSchemaProperties.java | |||
Method name: TableColumnInfo getColInfoByName(String)
|
Method name: SQLAliasSchemaDetailProperties getMatchingDetail(String, SQLAliasSchemaDetailProperties[])
|
|||
Number of AST nodes: 5 | 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 | TableColumnInfo colInfo = colInfos[i];↵ | 3 | ↵ | |
4 | if (colInfo.getColumnName().equals(columnName)) {↵ | 4 | if(schemaDetails[i].getSchemaName().equals(↵ | |
5 | schemaName))↵ | |||
5 | ↵ | 6 | {↵ | |
6 | return colInfo;↵ | 7 | return ↵ | |
7 | ↵ | 8 | schemaDetails[i];↵ | |
8 | }↵ | 9 | }↵ | |
9 | }↵ | 10 | ↵ | |
10 | ↵ | 11 | }↵ | |
11 | return null; | 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) | 0.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 4 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.5 |
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 | TableColumnInfo colInfo = colInfos[i]; |
| | |||||||||||||||
3 | if (colInfo.getColumnName().equals(columnName)) | | ||||||||||||||||
4 | return colInfo; |
| | |||||||||||||||
5 | return null; | 4 | return null; |
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 TableColumnInfo colInfo=colInfos[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched return colInfo; |