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: 7 | Number of AST nodes: 7 | |||
1 | JMeterProperty prop = getProperty(MAXTHROUGHPUT);↵ | 1 | JMeterProperty prop = getProperty(PERCENTTHROUGHPUT);↵ | |
2 | int retVal = 1;↵ | 2 | float retVal = 100;↵ | |
3 | if (prop instanceof IntegerProperty) {↵ | 3 | if (prop instanceof FloatProperty) {↵ | |
4 | retVal = (((IntegerProperty) prop).getIntValue());↵ | 4 | retVal = (((FloatProperty) prop).getFloatValue());↵ | |
5 | } else {↵ | 5 | } else {↵ | |
6 | try {↵ | 6 | try {↵ | |
7 | retVal = Integer.parseInt(prop.getStringValue());↵ | 7 | retVal = Float.parseFloat(prop.getStringValue());↵ | |
8 | } catch (NumberFormatException e) {↵ | 8 | } catch (NumberFormatException e) {↵ | |
9 | }↵ | 9 | }↵ | |
10 | }↵ | 10 | }↵ | |
11 | return retVal; | 11 |
| |
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 | 17 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 2.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | JMeterProperty prop = getProperty(MAXTHROUGHPUT); |
| 1 | JMeterProperty prop = getProperty(PERCENTTHROUGHPUT); | ||||||||||||
| 2 | float retVal = 100; | ||||||||||||||
2 | int retVal = 1; | | ||||||||||||||
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 | Expression prop instanceof IntegerProperty cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression prop instanceof FloatProperty cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement retVal=(((FloatProperty)prop).getFloatValue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement retVal=(((IntegerProperty)prop).getIntValue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement retVal=Float.parseFloat(prop.getStringValue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | 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 |
7 | Unmatched statement retVal=Integer.parseInt(prop.getStringValue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | 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 |
9 | Unmatched return retVal; |
10 | Unmatched return retVal; |