double rval = 0.0; if (counter == 0) { return (rval); } rval = (double) errorCount / (double) counter; return (rval);
double rval = 0.0; if (count == 0) { return (rval); } rval = (double) errors / (double) count; return (rval);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/RunningSample.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/util/Calculator.java
Method name: double getErrorPercentage() Method name: double getErrorPercentage()
Number of AST nodes: 5 Number of AST nodes: 5
1
double rval = 0.0;
1
double rval = 0.0;
2
		if (counter == 0) {
2
        if (count == 0) {
3
			return (rval);
3
            return (rval);
4
		}
5
		
4
        }
6
rval = (double) errorCount / (double) counter;
5
        rval = (double) errors / (double) count;
7
		return (rval);
6
        return (rval);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    double rval = 0.0;
    1
    double rval = 0.0;
    2
    if (counter == 0)
    2
    if (counter == 0)
    2
    if (count == 0)
    Differences
    Expression1Expression2Difference
    countercountVARIABLE_NAME_MISMATCH
    longintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type long of variable counter does not match with type int of variable count
    2
    if (count == 0)
    3
    return (rval);
    3
    return (rval);
    4
    rval = (double)errorCount / (double)counter;
    4
    rval = (double)errorCount / (double)counter;
    4
    rval = (double)errors / (double)count;
    Differences
    Expression1Expression2Difference
    errorCounterrorsVARIABLE_NAME_MISMATCH
    longintVARIABLE_TYPE_MISMATCH
    countercountVARIABLE_NAME_MISMATCH
    longintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type long of variable errorCount does not match with type int of variable errors
    Type long of variable counter does not match with type int of variable count
    4
    rval = (double)errors / (double)count;
    5
    return (rval);
    5
    return (rval);
    Precondition Violations (3)
    Row Violation
    1Type long of variable counter does not match with type int of variable count
    2Type long of variable errorCount does not match with type int of variable errors
    3Type long of variable counter does not match with type int of variable count