File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/store/LocalCalendarStore.java | File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/store/LocalCalendarStore.java | |||
Method name: Iterator
|
Method name: Iterator
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | if (c.getType().equals(IComponent.TYPE.TODO)) {↵ | 1 | if (c.getType().equals(IComponent.TYPE.TODO)) {↵ | |
2 | ITodo todo = (ITodo) c;↵ | 2 | ITodo todo = (ITodo) c;↵ | |
3 | Calendar startDate = todo.getDtStart();↵ | 3 | Calendar sd = todo.getDtStart();↵ | |
4 | Calendar endDate = todo.getDue();↵ | 4 | Calendar endDate = todo.getDue();↵ | |
5 | IDateRange dr = new DateRange(startDate, endDate);↵ | 5 | IDateRange dr = new DateRange(startDate, endDate);↵ | |
6 | if (dateRange.equals(dr))↵ | 6 | if (startDate.equals(sd))↵ | |
7 | result.add(id);↵ | 7 | result.add(id);↵ | |
8 | } else↵ | 8 | } else↵ | |
9 | throw new IllegalArgumentException(↵ | 9 | throw new IllegalArgumentException(↵ | |
10 | "unsupported component type " + c.getType()); | 10 |
| |
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 declared in the same class |
Number of node comparisons | 41 |
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) | 1.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13 | else if (c.getType().equals(IComponent.TYPE.TODO)) | 11 | else if (c.getType().equals(IComponent.TYPE.TODO)) | ||||||||||||||||||||||||
14 | ITodo todo = (ITodo)c; | 12 | ITodo todo = (ITodo)c; | ||||||||||||||||||||||||
15 | Calendar startDate = todo.getDtStart(); |
| 13 | Calendar sd = todo.getDtStart(); | |||||||||||||||||||||||
16 | Calendar endDate = todo.getDue(); | 14 | Calendar endDate = todo.getDue(); | ||||||||||||||||||||||||
17 | IDateRange dr = new DateRange(startDate, endDate); | 15 | IDateRange dr = new DateRange(startDate, endDate); | ||||||||||||||||||||||||
18 | if (dateRange.equals(dr)) |
| 16 | if (startDate.equals(sd)) | |||||||||||||||||||||||
19 | result.add(id); | 17 | result.add(id); | ||||||||||||||||||||||||
else | else | ||||||||||||||||||||||||||
20 | throw new IllegalArgumentException("unsupported component type " + c.getType()); | 18 | throw new IllegalArgumentException("unsupported component type " + c.getType()); |
Row | Violation |
---|---|
1 | Expression startDate cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression sd cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression dr cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression sd cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Type org.columba.calendar.model.api.IDateRange of variable dr does not match with type java.util.Calendar of variable sd |
6 | Type org.columba.calendar.model.api.IDateRange of variable dateRange does not match with type java.util.Calendar of variable startDate |