File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/functions/PackageTest.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/functions/PackageTest.java | |||
Method name: void checkSum(AbstractFunction, String, String[])
|
Method name: void checkSumNoVar(AbstractFunction, String, String[])
|
|||
Number of AST nodes: 7 | Number of AST nodes: 5 | |||
1 | Collection parms = new LinkedList();↵ | 1 | Collection parms = new LinkedList();↵ | |
2 | for (int i=0; i< addends.length; i++){↵ | 2 | for (int i=0; i< addends.length; i++){↵ | |
3 | parms.add(new CompoundVariable(addends[i]));↵ | 3 | parms.add(new CompoundVariable(addends[i]));↵ | |
4 | }↵ | |||
5 | parms.add(new CompoundVariable("Result"));↵ | |||
4 | }↵ | |||
6 | func.setParameters(parms);↵ | 5 | func.setParameters(parms);↵ | |
7 | assertEquals(value,func.execute(null,null));↵ | 6 | assertEquals(value,func.execute(null,null)); | |
8 | assertEquals(value,vars.getObject("Result")); | |||
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 13 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 4.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
1 | Collection parms = new LinkedList(); | 1 | Collection parms = new LinkedList(); | ||||
2 | for (int i = 0; i < addends.length; i++) | 2 | for (int i = 0; i < addends.length; i++) | ||||
3 | parms.add(new CompoundVariable(addends[i])); | 3 | parms.add(new CompoundVariable(addends[i])); | ||||
4 | parms.add(new CompoundVariable("Result")); |
| | ||||
5 | func.setParameters(parms); | 4 | func.setParameters(parms); | ||||
6 | assertEquals(value, func.execute(null, null)); | 5 | assertEquals(value, func.execute(null, null)); | ||||
7 | assertEquals(value, vars.getObject("Result")); | |
Row | Violation |
---|---|
1 | Unmatched statement parms.add(new CompoundVariable("Result")); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Clone fragment #1 returns variables parms , while Clone fragment #2 returns variables |