File path: /jfreechart-1.0.10/src/org/jfree/data/time/Month.java | File path: /jfreechart-1.0.10/src/org/jfree/data/time/Quarter.java | |||
Method name: RegularTimePeriod next()
|
Method name: RegularTimePeriod previous()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | Month result;↵ | 1 | Quarter result;↵ | |
2 | if (this.month != MonthConstants.DECEMBER) {↵ | 2 | if (this.quarter > FIRST_QUARTER) {↵ | |
3 | result = new Month(this.month + 1, this.year);↵ | 3 | result = new Quarter(this.quarter - 1, this.year);↵ | |
4 | }↵ | 4 | }↵ | |
5 | else {↵ | 5 | else {↵ | |
6 | if (this.year < 9999) {↵ | 6 | if (this.year > 1900) {↵ | |
7 | result = new Month(MonthConstants.JANUARY, this.year + 1);↵ | 7 | result = new Quarter(LAST_QUARTER, this.year - 1);↵ | |
8 | }↵ | 8 | }↵ | |
9 | else {↵ | 9 | else {↵ | |
10 | result = null;↵ | 10 | result = null;↵ | |
11 | }↵ | 11 | }↵ | |
12 | }↵ | 12 | }↵ | |
13 | return result; | 13 |
| |
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 in different classes having the same super class |
Number of node comparisons | 17 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 5 |
Time elapsed for statement mapping (ms) | 4.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Month result; |
| 1 | Quarter result; | |||||||||||||
| 2 | if (this.quarter > FIRST_QUARTER) | |||||||||||||||
|
| 3 | result = new Quarter(this.quarter - 1, this.year); | ||||||||||||||
| 4 | if (this.year > 1900) | |||||||||||||||
|
| 5 | result = new Quarter(LAST_QUARTER, this.year - 1); | ||||||||||||||
| else | ||||||||||||||||
|
| 6 | result = null; | ||||||||||||||
2 | if (this.month != MonthConstants.DECEMBER) | | |||||||||||||||
3 | result = new Month(this.month + 1, this.year); |
| | ||||||||||||||
4 | if (this.year < 9999) | | |||||||||||||||
5 | result = new Month(MonthConstants.JANUARY, this.year + 1); |
| | ||||||||||||||
else | | ||||||||||||||||
6 | result = null; |
| | ||||||||||||||
7 | return result; |
| 7 | return result; |
Row | Violation |
---|---|
1 | Unmatched statement result=new Quarter(this.quarter - 1,this.year); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement result=new Quarter(LAST_QUARTER,this.year - 1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement result=null; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement result=new Month(this.month + 1,this.year); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement result=new Month(MonthConstants.JANUARY,this.year + 1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement result=null; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |