File path: /sql12/plugins/dataimport/src/net/sourceforge/squirrel_sql/plugins/dataimport/importer/excel/ExcelFileImporter.java | File path: /sql12/plugins/dataimport/src/net/sourceforge/squirrel_sql/plugins/dataimport/importer/excel/ExcelFileImporter.java | |||
Method name: Date getDate(int)
|
Method name: Integer getInt(int)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | checkPointer();↵ | 1 | checkPointer();↵ | |
2 | Cell cell = sheet.getCell(column, pointer);↵ | 2 | Cell cell = sheet.getCell(column, pointer);↵ | |
3 | if (cell.getType() != CellType.DATE) {↵ | 3 | if (cell.getType() != CellType.NUMBER) {↵ | |
4 | throw new UnsupportedFormatException();↵ | 4 | throw new UnsupportedFormatException();↵ | |
5 | }↵ | 5 | }↵ | |
6 | return ((DateCell) cell).getDate(); | 6 | return (new Double(((NumberCell) cell).getValue())).intValue(); | |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 13 |
Number of mapped statements | 4 |
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) | 1.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | checkPointer(); | 1 | checkPointer(); | |||||||||||
2 | Cell cell = sheet.getCell(column, pointer); | 2 | Cell cell = sheet.getCell(column, pointer); | |||||||||||
3 | if (cell.getType() != CellType.DATE) |
| 3 | if (cell.getType() != CellType.NUMBER) | ||||||||||
4 | throw new UnsupportedFormatException(); | 4 | throw new UnsupportedFormatException(); | |||||||||||
|
| 5 | return (new Double(((NumberCell)cell).getValue())).intValue(); | |||||||||||
5 | return ((DateCell)cell).getDate(); |
| |
Row | Violation |
---|---|
1 | Unmatched statement return (new Double(((NumberCell)cell).getValue())).intValue(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched return (new Double(((NumberCell)cell).getValue())).intValue(); |
3 | Unmatched statement return ((DateCell)cell).getDate(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched return ((DateCell)cell).getDate(); |