File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/ThroughputController.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/ThroughputController.java | |||
Method name: int getMaxThroughputAsInt()
|
Method name: float getPercentThroughputAsFloat()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | if (prop instanceof IntegerProperty) {↵ | 1 | if (prop instanceof FloatProperty) {↵ | |
2 | retVal = (((IntegerProperty) prop).getIntValue());↵ | 2 | retVal = (((FloatProperty) prop).getFloatValue());↵ | |
3 | } else {↵ | 3 | } else {↵ | |
4 | try {↵ | 4 | try {↵ | |
5 | retVal = Integer.parseInt(prop.getStringValue());↵ | 5 | retVal = Float.parseFloat(prop.getStringValue());↵ | |
6 | } catch (NumberFormatException e) {↵ | 6 | } catch (NumberFormatException e) {↵ | |
7 | }↵ | 7 | }↵ | |
8 | }↵ | 8 | }↵ | |
9 | return retVal; | 9 |
| |
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 9 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | if (prop instanceof IntegerProperty) |
| 3 | if (prop instanceof FloatProperty) | ||||||||||
|
| 4 | retVal = (((FloatProperty)prop).getFloatValue()); | |||||||||||
4 | retVal = (((IntegerProperty)prop).getIntValue()); |
| | |||||||||||
5 | try | 5 | try | |||||||||||
|
| 6 | retVal = Float.parseFloat(prop.getStringValue()); | |||||||||||
6 | retVal = Integer.parseInt(prop.getStringValue()); |
| | |||||||||||
|
| 7 | return retVal; | |||||||||||
7 | return retVal; |
| |
Row | Violation |
---|---|
1 | Unmatched statement retVal=(((FloatProperty)prop).getFloatValue()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement retVal=(((IntegerProperty)prop).getIntValue()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement retVal=Float.parseFloat(prop.getStringValue()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched statement retVal=Float.parseFloat(prop.getStringValue()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
5 | Unmatched statement retVal=Integer.parseInt(prop.getStringValue()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Unmatched statement retVal=Integer.parseInt(prop.getStringValue()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
7 | Unmatched return retVal; |
8 | Unmatched return retVal; |