File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/util/accesslog/TCLogParser.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/util/accesslog/SharedTCLogParser.java | |||
Method name: int parse(BufferedReader, TestElement, int)
|
Method name: int parse(FileServer, TestElement, int)
|
|||
Number of AST nodes: 15 | Number of AST nodes: 13 | |||
1 | int actualCount = 0;↵ | 1 | int actualCount = 0;↵ | |
2 | String line = null;↵ | 2 | String line = null;↵ | |
3 | try {↵ | 3 | try {↵ | |
4 | // read one line at a time using↵ | 4 | // read one line at a time using↵ | |
5 | // BufferedReader↵ | 5 | // BufferedReader↵ | |
6 | line = breader.readLine();↵ | 6 | line = breader.readLine(FILENAME);↵ | |
7 | while (line != null) {↵ | 7 | while (line != null) {↵ | |
8 | if (line.length() > 0) {↵ | 8 | if (line.length() > 0) {↵ | |
9 | actualCount += this.parseLine(line, el);↵ | 9 | actualCount += this.parseLine(line, el);↵ | |
10 | }↵ | 10 | }↵ | |
11 | // we check the count to see if we have exceeded↵ | 11 | // we check the count to see if we have exceeded↵ | |
12 | // the number of lines to parse. There's no way↵ | 12 | // the number of lines to parse. There's no way↵ | |
13 | // to know where to stop in the file. Therefore↵ | 13 | // to know where to stop in the file. Therefore↵ | |
14 | // we use break to escape the while loop when↵ | 14 | // we use break to escape the while loop when↵ | |
15 | // we've reached the count.↵ | 15 | // we've reached the count.↵ | |
16 | if (parseCount != -1 && actualCount >= parseCount) {↵ | 16 | if (parseCount != -1 && actualCount >= parseCount) {↵ | |
17 | break;↵ | 17 | break;↵ | |
18 | }↵ | 18 | }↵ | |
19 | line = breader.readLine();↵ | 19 | line = breader.readLine(FILENAME);↵ | |
20 | }↵ | 20 | }↵ | |
21 | if (line == null) {↵ | 21 | if (line == null) {↵ | |
22 | breader.close();↵ | 22 | breader.close↵ | |
23 | breader = null;↵ | |||
24 | this.READER = null;↵ | 23 | File(FILENAME);↵ | |
25 | // this.READER = new BufferedReader(new↵ | 24 | // this.READER = new BufferedReader(new↵ | |
26 | // FileReader(this.SOURCE));↵ | 25 | // FileReader(this.SOURCE));↵ | |
27 | // parse(this.READER,el);↵ | 26 | // parse(this.READER,el);↵ | |
28 | }↵ | 27 | }↵ | |
29 | } catch (IOException ioe) {↵ | 28 | } catch (IOException ioe) {↵ | |
30 | log.error("Error reading log file", ioe);↵ | 29 | log.error("Error reading log file", ioe);↵ | |
31 | }↵ | 30 | }↵ | |
32 | return actualCount; | 31 |
| |
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.8 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 38 |
Number of mapped statements | 10 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 22.3 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||
---|---|---|---|---|---|---|---|---|
1 | int actualCount = 0; | 1 | int actualCount = 0; | |||||
2 | String line = null; | 2 | String line = null; | |||||
3 | try | 3 | try | |||||
|
| 4 | line = breader.readLine(FILENAME); | |||||
4 | line = breader.readLine(); |
| | |||||
5 | while (line != null) | 5 | while (line != null) | |||||
6 | if (line.length() > 0) | 6 | if (line.length() > 0) | |||||
7 | actualCount += this.parseLine(line, el); | 7 | actualCount += this.parseLine(line, el); | |||||
8 | if (parseCount != -1 && actualCount >= parseCount) | 8 | if (parseCount != -1 && actualCount >= parseCount) | |||||
9 | break; | 9 | break; | |||||
|
| 10 | line = breader.readLine(FILENAME); | |||||
10 | line = breader.readLine(); |
| | |||||
11 | if (line == null) | 11 | if (line == null) | |||||
|
| 12 | breader.closeFile(FILENAME); | |||||
12 | breader.close(); |
| | |||||
13 | breader = null; | | ||||||
14 | this.READER = null; | | ||||||
15 | return actualCount; | 13 | return actualCount; |
Row | Violation |
---|---|
1 | Unmatched statement line=breader.readLine(FILENAME); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement line=breader.readLine(FILENAME); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
3 | Unmatched statement line=breader.readLine(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement line=breader.readLine(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
5 | Unmatched statement line=breader.readLine(FILENAME); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement line=breader.readLine(FILENAME); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
7 | Unmatched statement line=breader.readLine(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Unmatched statement line=breader.readLine(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
9 | Unmatched statement breader.closeFile(FILENAME); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
10 | Unmatched statement breader.close(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |