double rate = 0;
if (this.getElapsed() > 0 && calculator.getTotalBytes() > 0) {
rate = calculator.getTotalBytes() / ((double) this.getElapsed() / 1000);
}
if (rate < 0) {
rate = 0;
}
return rate;
double rate = 0;
if (this.getElapsed() > 0 && calculator.getTotalBytes() > 0) {
rate = calculator.getTotalBytes() / ((double) this.getElapsed() / 1000);
}
if (rate < 0) {
rate = 0;
}
return rate;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/SamplingStatCalculator.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/SamplingStatCalculator.java
|
Method name: double getPageSize()
|
|
Method name: double getAvgPageBytes()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | double rate = 0;↵ | | 1 | double rate = 0;↵
|
2 | if (this.getElapsed() > 0 && calculator.getTotalBytes() > 0) {↵ | | 2 | if (this.getElapsed() > 0 && calculator.getTotalBytes() > 0) {↵
|
3 | rate = calculator.getTotalBytes() / ((double) this.getElapsed() / 1000);↵ | | 3 | rate = calculator.getTotalBytes() / ((double) this.getElapsed() / 1000);↵
|
4 | }↵ | | 4 | }↵
|
5 | if (rate < 0) {↵ | | 5 | if (rate < 0) {↵
|
6 | rate = 0;↵ | | 6 | rate = 0;↵
|
7 | }↵ | | 7 | }↵
|
8 | return rate; | | 8 | return rate;
|
See real code fragment |
|
See real code fragment |
Summary
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 17 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 0.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | double rate = 0; | | 1 | double rate = 0; |
2 | if (this.getElapsed() > 0 && calculator.getTotalBytes() > 0) | | 2 | if (this.getElapsed() > 0 && calculator.getTotalBytes() > 0) |
3 | rate = calculator.getTotalBytes() / ((double)this.getElapsed() / 1000); | | 3 | rate = calculator.getTotalBytes() / ((double)this.getElapsed() / 1000); |
4 | if (rate < 0) | | 4 | if (rate < 0) |
5 | | | 5 | |
6 | return rate; | | 6 | return rate; |
Precondition Violations (0)
Row |
Violation |