File path: /sql12/plugins/dataimport/src/com/csvreader/CsvReader.java | File path: /sql12/plugins/dataimport/src/com/csvreader/CsvReader.java | |||
Method name: void checkDataLength()
|
Method name: void updateCurrentValue()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | if (rawBuffer.Buffer.length - rawBuffer.Position < dataBuffer.Count↵ | 1 | if (columnBuffer.Buffer.length - columnBuffer.Position < dataBuffer.Position↵ | |
2 | - dataBuffer.LineStart) {↵ | 2 | - dataBuffer.ColumnStart) {↵ | |
3 | int newLength = rawBuffer.Buffer.length↵ | 3 | int newLength = columnBuffer.Buffer.length↵ | |
4 | + Math.max(↵ | 4 | + Math.max(↵ | |
5 | dataBuffer.Count - dataBuffer.LineStart,↵ | 5 | dataBuffer.Position - dataBuffer.ColumnStart,↵ | |
6 | rawBuffer.Buffer.length);↵ | 6 | columnBuffer.Buffer.length);↵ | |
7 | char[] holder = new char[newLength];↵ | 7 | char[] holder = new char[newLength];↵ | |
8 | System.arraycopy(rawBuffer.Buffer, 0, holder, 0,↵ | 8 | System.arraycopy(columnBuffer.Buffer, 0, holder, 0,↵ | |
9 | rawBuffer.Position);↵ | 9 | columnBuffer.Position);↵ | |
10 | rawBuffer.Buffer = holder;↵ | 10 | columnBuffer.Buffer = holder;↵ | |
11 | }↵ | 11 | }↵ | |
12 | System.arraycopy(dataBuffer.Buffer, dataBuffer.LineStart,↵ | 12 | System.arraycopy(dataBuffer.Buffer, dataBuffer.ColumnStart,↵ | |
13 | rawBuffer.Buffer, rawBuffer.Position, ↵ | 13 | columnBuffer.Buffer, columnBuffer.Position,↵ | |
14 | dataBuffer.Count↵ | 14 | dataBuffer.↵ | |
15 | - dataBuffer.LineStart);↵ | 15 | Position - dataBuffer.ColumnStart);↵ | |
16 | rawBuffer.Position += dataBuffer.Count ↵ | 16 | columnBuffer.Position += dataBuffer.Position↵ | |
17 | - dataBuffer.LineStart; | 17 | - dataBuffer.ColumnStart; | |
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.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 30 |
Number of mapped statements | 7 |
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) | 6.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8 | if (rawBuffer.Buffer.length - rawBuffer.Position < dataBuffer.Count - dataBuffer.LineStart) |
| 2 | if (columnBuffer.Buffer.length - columnBuffer.Position < dataBuffer.Position - dataBuffer.ColumnStart) | |||||||||||||||||||||||||||||||||||
9 | int newLength = rawBuffer.Buffer.length + Math.max(dataBuffer.Count - dataBuffer.LineStart, rawBuffer.Buffer.length); |
| 3 | int newLength = columnBuffer.Buffer.length + Math.max(dataBuffer.Position - dataBuffer.ColumnStart, columnBuffer.Buffer.length); | |||||||||||||||||||||||||||||||||||
10 | char[] holder = new char[newLength]; | 4 | char[] holder = new char[newLength]; | ||||||||||||||||||||||||||||||||||||
11 | System.arraycopy(rawBuffer.Buffer, 0, holder, 0, rawBuffer.Position); |
| 5 | System.arraycopy(columnBuffer.Buffer, 0, holder, 0, columnBuffer.Position); | |||||||||||||||||||||||||||||||||||
12 | rawBuffer.Buffer = holder; |
| 6 | columnBuffer.Buffer = holder; | |||||||||||||||||||||||||||||||||||
13 | System.arraycopy(dataBuffer.Buffer, dataBuffer.LineStart, rawBuffer.Buffer, rawBuffer.Position, dataBuffer.Count - dataBuffer.LineStart); |
| 7 | System.arraycopy(dataBuffer.Buffer, dataBuffer.ColumnStart, columnBuffer.Buffer, columnBuffer.Position, dataBuffer.Position - dataBuffer.ColumnStart); | |||||||||||||||||||||||||||||||||||
14 | rawBuffer.Position += dataBuffer.Count - dataBuffer.LineStart; |
| 8 | columnBuffer.Position += dataBuffer.Position - dataBuffer.ColumnStart; |
Row | Violation |
---|---|
1 | Type char[] of variable rawBuffer.Buffer does not match with type char[] of variable columnBuffer.Buffer |
2 | Type int of variable rawBuffer.Position does not match with type int of variable columnBuffer.Position |
3 | Expression rawBuffer.Buffer cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression columnBuffer.Buffer cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Type char[] of variable rawBuffer.Buffer does not match with type char[] of variable columnBuffer.Buffer |
6 | Expression dataBuffer.Count cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression dataBuffer.Position cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression dataBuffer.LineStart cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression dataBuffer.ColumnStart cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression rawBuffer.Buffer cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression columnBuffer.Buffer cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Type char[] of variable rawBuffer.Buffer does not match with type char[] of variable columnBuffer.Buffer |
13 | Expression rawBuffer.Buffer cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression columnBuffer.Buffer cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Type char[] of variable rawBuffer.Buffer does not match with type char[] of variable columnBuffer.Buffer |
16 | Expression rawBuffer.Position cannot be parameterized, because it has dependencies to/from statements that will be extracted |
17 | Expression columnBuffer.Position cannot be parameterized, because it has dependencies to/from statements that will be extracted |
18 | Type int of variable rawBuffer.Position does not match with type int of variable columnBuffer.Position |
19 | Expression rawBuffer.Buffer cannot be parameterized, because it has dependencies to/from statements that will be extracted |
20 | Expression columnBuffer.Buffer cannot be parameterized, because it has dependencies to/from statements that will be extracted |
21 | Type char[] of variable rawBuffer.Buffer does not match with type char[] of variable columnBuffer.Buffer |
22 | Expression rawBuffer.Buffer cannot be parameterized, because it has dependencies to/from statements that will be extracted |
23 | Expression columnBuffer.Buffer cannot be parameterized, because it has dependencies to/from statements that will be extracted |
24 | Type char[] of variable rawBuffer.Buffer does not match with type char[] of variable columnBuffer.Buffer |
25 | Expression rawBuffer.Position cannot be parameterized, because it has dependencies to/from statements that will be extracted |
26 | Expression columnBuffer.Position cannot be parameterized, because it has dependencies to/from statements that will be extracted |
27 | Type int of variable rawBuffer.Position does not match with type int of variable columnBuffer.Position |
28 | Expression rawBuffer.Position cannot be parameterized, because it has dependencies to/from statements that will be extracted |
29 | Expression columnBuffer.Position cannot be parameterized, because it has dependencies to/from statements that will be extracted |
30 | Type int of variable rawBuffer.Position does not match with type int of variable columnBuffer.Position |