if (HEALTH) { int hly = (int) (height - (height * (model.getHealth() / 3.0))); int lasty = (int) (height - (height * (last.getHealth() / 3.0))); g.setColor(Color.green); g.drawLine(lastx, lasty, xaxis, hly); } if (LOAD) { int ldy = (int) (height - (height * (model.getLoad() / 100.0))); int lastldy = (int) (height - (height * (last.getLoad() / 100.0))); g.setColor(Color.blue); g.drawLine(lastx, lastldy, xaxis, ldy); } if (MEM) { int mmy = (int) (height - (height * (model.getMemload() / 100.0))); int lastmmy = (int) (height - (height * (last.getMemload() / 100.0))); g.setColor(Color.orange); g.drawLine(lastx, lastmmy, xaxis, mmy); }
if (LOAD) { int ldy = (int) (height - (height * (model.getLoad() / 100.0))); int lastldy = (int) (height - (height * (last.getLoad() / 100.0))); g.setColor(Color.blue); g.drawLine(lastx, lastldy, xaxis, ldy); } if (MEM) { int mmy = (int) (height - (height * (model.getMemload() / 100.0))); int lastmmy = (int) (height - (height * (last.getMemload() / 100.0))); g.setColor(Color.orange); g.drawLine(lastx, lastmmy, xaxis, mmy); } if (THREAD) { int thy = (int) (height - (height * (model.getThreadload() / 100.0))); int lastthy = (int) (height - (height * (last.getThreadload() / 100.0))); g.setColor(Color.red); g.drawLine(lastx, lastthy, xaxis, thy); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/MonitorGraph.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/MonitorGraph.java
Method name: void drawSample(int, MonitorModel, Graphics, MonitorModel) Method name: void drawSample(int, MonitorModel, Graphics, MonitorModel)
Number of AST nodes: 15 Number of AST nodes: 15
1
if (HEALTH) {
2
			int hly = (int) (height - (height * (model.getHealth() / 3.0)));
3
			int lasty = (int) (height - (height * (last.getHealth() / 3.0)));
4
			g.setColor(Color.green);
5
			g.drawLine(lastx, lasty, xaxis, hly);
6
		}
7
		if (LOAD) {
1
if (LOAD) {
8
			int ldy = (int) (height - (height * (model.getLoad() / 100.0)));
2
			int ldy = (int) (height - (height * (model.getLoad() / 100.0)));
9
			int lastldy = (int) (height - (height * (last.getLoad() / 100.0)));
3
			int lastldy = (int) (height - (height * (last.getLoad() / 100.0)));
10
			g.setColor(Color.blue);
4
			g.setColor(Color.blue);
11
			g.drawLine(lastx, lastldy, xaxis, ldy);
5
			g.drawLine(lastx, lastldy, xaxis, ldy);
12
		}
6
		}
13
		if (MEM) {
7
		if (MEM) {
14
			int mmy = (int) (height - (height * (model.getMemload() / 100.0)));
8
			int mmy = (int) (height - (height * (model.getMemload() / 100.0)));
15
			int lastmmy = (int) (height - (height * (last.getMemload() / 100.0)));
9
			int lastmmy = (int) (height - (height * (last.getMemload() / 100.0)));
16
			g.setColor(Color.orange);
10
			g.setColor(Color.orange);
17
			g.drawLine(lastx, lastmmy, xaxis, mmy);
11
			g.drawLine(lastx, lastmmy, xaxis, mmy);
18
		}
12
		}
13
		if (THREAD) {
14
			int thy = (int) (height - (height * (model.getThreadload() / 100.0)));
15
			int lastthy = (int) (height - (height * (last.getThreadload() / 100.0)));
16
			g.setColor(Color.red);
17
			g.drawLine(lastx, lastthy, xaxis, thy);
18
		}
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.3
Clones locationClones are in the same method
Number of node comparisons153
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements15
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)15.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    21
    if (HEALTH)
    21
    if (HEALTH)
    26
    if (LOAD)
    Differences
    Expression1Expression2Difference
    HEALTHLOADVARIABLE_NAME_MISMATCH
    26
    if (LOAD)
    22
    int hly = (int)(height - (height * (model.getHealth() / 3.0)));
    22
    int hly = (int)(height - (height * (model.getHealth() / 3.0)));
    27
    int ldy = (int)(height - (height * (model.getLoad() / 100.0)));
    Differences
    Expression1Expression2Difference
    hlyldyVARIABLE_NAME_MISMATCH
    getHealthgetLoadMETHOD_INVOCATION_NAME_MISMATCH
    3.0100.0LITERAL_VALUE_MISMATCH
    27
    int ldy = (int)(height - (height * (model.getLoad() / 100.0)));
    23
    int lasty = (int)(height - (height * (last.getHealth() / 3.0)));
    23
    int lasty = (int)(height - (height * (last.getHealth() / 3.0)));
    28
    int lastldy = (int)(height - (height * (last.getLoad() / 100.0)));
    Differences
    Expression1Expression2Difference
    lastylastldyVARIABLE_NAME_MISMATCH
    getHealthgetLoadMETHOD_INVOCATION_NAME_MISMATCH
    3.0100.0LITERAL_VALUE_MISMATCH
    28
    int lastldy = (int)(height - (height * (last.getLoad() / 100.0)));
    24
    g.setColor(Color.green);
    24
    g.setColor(Color.green);
    29
    g.setColor(Color.blue);
    Differences
    Expression1Expression2Difference
    greenblueVARIABLE_NAME_MISMATCH
    29
    g.setColor(Color.blue);
    25
    g.drawLine(lastx, lasty, xaxis, hly);
    25
    g.drawLine(lastx, lasty, xaxis, hly);
    30
    g.drawLine(lastx, lastldy, xaxis, ldy);
    Differences
    Expression1Expression2Difference
    lastylastldyVARIABLE_NAME_MISMATCH
    hlyldyVARIABLE_NAME_MISMATCH
    30
    g.drawLine(lastx, lastldy, xaxis, ldy);
    26
    if (LOAD)
    26
    if (LOAD)
    31
    if (MEM)
    Differences
    Expression1Expression2Difference
    LOADMEMVARIABLE_NAME_MISMATCH
    31
    if (MEM)
    27
    int ldy = (int)(height - (height * (model.getLoad() / 100.0)));
    27
    int ldy = (int)(height - (height * (model.getLoad() / 100.0)));
    32
    int mmy = (int)(height - (height * (model.getMemload() / 100.0)));
    Differences
    Expression1Expression2Difference
    ldymmyVARIABLE_NAME_MISMATCH
    getLoadgetMemloadMETHOD_INVOCATION_NAME_MISMATCH
    32
    int mmy = (int)(height - (height * (model.getMemload() / 100.0)));
    28
    int lastldy = (int)(height - (height * (last.getLoad() / 100.0)));
    28
    int lastldy = (int)(height - (height * (last.getLoad() / 100.0)));
    33
    int lastmmy = (int)(height - (height * (last.getMemload() / 100.0)));
    Differences
    Expression1Expression2Difference
    lastldylastmmyVARIABLE_NAME_MISMATCH
    getLoadgetMemloadMETHOD_INVOCATION_NAME_MISMATCH
    33
    int lastmmy = (int)(height - (height * (last.getMemload() / 100.0)));
    29
    g.setColor(Color.blue);
    29
    g.setColor(Color.blue);
    34
    g.setColor(Color.orange);
    Differences
    Expression1Expression2Difference
    blueorangeVARIABLE_NAME_MISMATCH
    34
    g.setColor(Color.orange);
    30
    g.drawLine(lastx, lastldy, xaxis, ldy);
    30
    g.drawLine(lastx, lastldy, xaxis, ldy);
    35
    g.drawLine(lastx, lastmmy, xaxis, mmy);
    Differences
    Expression1Expression2Difference
    lastldylastmmyVARIABLE_NAME_MISMATCH
    ldymmyVARIABLE_NAME_MISMATCH
    35
    g.drawLine(lastx, lastmmy, xaxis, mmy);
    31
    if (MEM)
    31
    if (MEM)
    36
    if (THREAD)
    Differences
    Expression1Expression2Difference
    MEMTHREADVARIABLE_NAME_MISMATCH
    36
    if (THREAD)
    32
    int mmy = (int)(height - (height * (model.getMemload() / 100.0)));
    32
    int mmy = (int)(height - (height * (model.getMemload() / 100.0)));
    37
    int thy = (int)(height - (height * (model.getThreadload() / 100.0)));
    Differences
    Expression1Expression2Difference
    mmythyVARIABLE_NAME_MISMATCH
    getMemloadgetThreadloadMETHOD_INVOCATION_NAME_MISMATCH
    37
    int thy = (int)(height - (height * (model.getThreadload() / 100.0)));
    33
    int lastmmy = (int)(height - (height * (last.getMemload() / 100.0)));
    33
    int lastmmy = (int)(height - (height * (last.getMemload() / 100.0)));
    38
    int lastthy = (int)(height - (height * (last.getThreadload() / 100.0)));
    Differences
    Expression1Expression2Difference
    lastmmylastthyVARIABLE_NAME_MISMATCH
    getMemloadgetThreadloadMETHOD_INVOCATION_NAME_MISMATCH
    38
    int lastthy = (int)(height - (height * (last.getThreadload() / 100.0)));
    34
    g.setColor(Color.orange);
    34
    g.setColor(Color.orange);
    39
    g.setColor(Color.red);
    Differences
    Expression1Expression2Difference
    orangeredVARIABLE_NAME_MISMATCH
    39
    g.setColor(Color.red);
    35
    g.drawLine(lastx, lastmmy, xaxis, mmy);
    35
    g.drawLine(lastx, lastmmy, xaxis, mmy);
    40
    g.drawLine(lastx, lastthy, xaxis, thy);
    Differences
    Expression1Expression2Difference
    lastmmylastthyVARIABLE_NAME_MISMATCH
    mmythyVARIABLE_NAME_MISMATCH
    40
    g.drawLine(lastx, lastthy, xaxis, thy);
    Precondition Violations (0)
    Row Violation