File path: /jfreechart-1.0.10/src/org/jfree/data/category/CategoryToPieDataset.java | File path: /jfreechart-1.0.10/src/org/jfree/data/category/CategoryToPieDataset.java | |||
Method name: int getItemCount()
|
Method name: int getIndex(Comparable)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 5 | |||
1 | int result = 0;↵ | |||
2 | if (this.source != null) {↵ | 1 | if (this.source != null) {↵ | |
3 | if (this.extract == TableOrder.BY_ROW) {↵ | 2 | if (this.extract == TableOrder.BY_ROW) {↵ | |
4 | result = this.source.getColumnCount();↵ | 3 | result = this.source.getColumnIndex(key);↵ | |
5 | }↵ | 4 | }↵ | |
6 | else if (this.extract == TableOrder.BY_COLUMN) {↵ | 5 | else if (this.extract == TableOrder.BY_COLUMN) {↵ | |
7 | result = this.source.getRowCount();↵ | 6 | result = this.source.getRowIndex(key);↵ | |
8 | }↵ | 7 | }↵ | |
9 | }↵ | 8 |
| |
10 | return result; | |||
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 14 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 4.4 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | int result = 0; | | |||||||||||||||||||
2 | if (this.source != null) | 2 | if (this.source != null) | ||||||||||||||||||
3 | if (this.extract == TableOrder.BY_ROW) | 3 | if (this.extract == TableOrder.BY_ROW) | ||||||||||||||||||
4 | result = this.source.getColumnCount(); |
| 4 | result = this.source.getColumnIndex(key); | |||||||||||||||||
5 | else if (this.extract == TableOrder.BY_COLUMN) | 5 | else if (this.extract == TableOrder.BY_COLUMN) | ||||||||||||||||||
6 | result = this.source.getRowCount(); |
| 6 | result = this.source.getRowIndex(key); | |||||||||||||||||
7 | return result; |
| |
Row | Violation |
---|---|
1 | Expression this.source.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression this.source.getColumnIndex(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression this.source.getColumnCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression this.source.getColumnIndex(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression this.source.getRowCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression this.source.getRowIndex(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression this.source.getRowCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression this.source.getRowIndex(key) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Unmatched statement return result; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
10 | Unmatched return result; |