if (counter == 0) { return 0.0; // Better behaviour when howLong=0 or lastTime=0 } long howLongRunning = lastTime - firstTime; if (howLongRunning == 0) { return Double.MAX_VALUE; } return (double) counter / howLongRunning * 60000.0;
if (counter == 0) { return 0.0; // Better behaviour when howLong=0 or lastTime=0 } long howLongRunning = lastTime - firstTime; if (howLongRunning == 0) { return Double.MAX_VALUE; } return (double) counter / howLongRunning * 1000.0;
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/visualizers/RunningSample.java
Method name: double getRatePerMin() Method name: double getRate()
Number of AST nodes: 6 Number of AST nodes: 6
1
if (counter == 0) {
1
if (counter == 0) {
2
			return 0.0; // Better behaviour when howLong=0 or lastTime=0
2
			return 0.0; // Better behaviour when howLong=0 or lastTime=0
3
		}
3
		}
4
		long howLongRunning = lastTime - firstTime;
4
		long howLongRunning = lastTime - firstTime;
5
		if (howLongRunning == 0) {
5
		if (howLongRunning == 0) {
6
			return Double.MAX_VALUE;
6
			return Double.MAX_VALUE;
7
		}
7
		}
8
		return (double) counter / howLongRunning * 60000.0;
8
		return (double) counter / howLongRunning * 1000.0;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons17
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (counter == 0)
    1
    if (counter == 0)
    2
    return 0.0;
    2
    return 0.0;
    3
    long howLongRunning = lastTime - firstTime;
    3
    long howLongRunning = lastTime - firstTime;
    4
    if (howLongRunning == 0)
    4
    if (howLongRunning == 0)
    5
    return Double.MAX_VALUE;
    5
    return Double.MAX_VALUE;
    6
    return (double)counter / howLongRunning * 60000.0;
    6
    return (double)counter / howLongRunning * 60000.0;
    6
    return (double)counter / howLongRunning * 1000.0;
    Differences
    Expression1Expression2Difference
    60000.01000.0LITERAL_VALUE_MISMATCH
    6
    return (double)counter / howLongRunning * 1000.0;
    Precondition Violations (0)
    Row Violation