File path: /jfreechart-1.0.10/src/org/jfree/data/time/Second.java | File path: /jfreechart-1.0.10/src/org/jfree/data/time/Second.java | |||
Method name: RegularTimePeriod previous()
|
Method name: RegularTimePeriod next()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | if (this.second != FIRST_SECOND_IN_MINUTE) {↵ | 1 | if (this.second != LAST_SECOND_IN_MINUTE) {↵ | |
2 | result = new Second(this.second - 1, getMinute());↵ | 2 | result = new Second(this.second + 1, getMinute());↵ | |
3 | }↵ | 3 | }↵ | |
4 | else {↵ | 4 | else {↵ | |
5 | Minute previous = (Minute) getMinute().previous();↵ | 5 | Minute next = (Minute) getMinute().next();↵ | |
6 | if (previous != null) {↵ | 6 | if (next != null) {↵ | |
7 | result = new Second(LAST_SECOND_IN_MINUTE, previous);↵ | 7 | result = new Second(FIRST_SECOND_IN_MINUTE, next);↵ | |
8 | }↵ | 8 | }↵ | |
9 | } | 9 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
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 | 5 |
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 | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | if (this.second != FIRST_SECOND_IN_MINUTE) |
| 2 | if (this.second != LAST_SECOND_IN_MINUTE) | |||||||||||||
3 | result = new Second(this.second - 1, getMinute()); |
| 3 | result = new Second(this.second + 1, getMinute()); | |||||||||||||
else | else | ||||||||||||||||
4 | Minute previous = (Minute)getMinute().previous(); |
| 4 | Minute next = (Minute)getMinute().next(); | |||||||||||||
5 | if (previous != null) |
| 5 | if (next != null) | |||||||||||||
6 | result = new Second(LAST_SECOND_IN_MINUTE, previous); |
| 6 | result = new Second(FIRST_SECOND_IN_MINUTE, next); |
Row | Violation |
---|---|
1 | Expression this.second - 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression this.second + 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |