File path: /apache-jmeter-2.11/src/core/org/apache/jmeter/gui/action/EnableComponent.java | File path: /apache-jmeter-2.11/src/core/org/apache/jmeter/gui/action/EnableComponent.java | |||
Method name: void toggleComponents(JMeterTreeNode[])
|
Method name: void enableComponents(JMeterTreeNode[], boolean)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 3 | |||
1 | private void toggleComponents(JMeterTreeNode[] nodes) { | 1 | private void enableComponents(JMeterTreeNode[] nodes, boolean enable) { | |
2 | GuiPackage pack = GuiPackage.getInstance(); | 2 | GuiPackage pack = GuiPackage.getInstance(); | |
3 | for (int i = 0; i < nodes.length; i++) { | 3 | for (JMeterTreeNode node : nodes) { | |
4 | boolean enable = !nodes[i].isEnabled(); | 4 | node.setEnabled(enable); | |
5 | nodes[i].setEnabled(enable); | 5 | pack.getGui(node.getTestElement()).setEnabled(enable); | |
6 | pack.getGui(nodes[i].getTestElement()).setEnabled(enable); | 6 | } | |
7 | } | 7 | } | |
8 | } | |||
See real code fragment | See real code fragment |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Similarity Score | 0.600 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | for (int i = 0; i < nodes.length; i++) | 2 | for (JMeterTreeNode node : nodes) | |||||||||||||
3 | boolean enable = !nodes[i].isEnabled(); |
| | |||||||||||||
4 | nodes[i].setEnabled(enable); |
| 3 | node.setEnabled(enable); | ||||||||||||
5 | pack.getGui(nodes[i].getTestElement()).setEnabled(enable); |
| 4 | pack.getGui(node.getTestElement()).setEnabled(enable); |
Row | Violation |
---|---|
1 | Unmatched statement boolean enable=!nodes[i].isEnabled(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Expression nodes[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression node cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression nodes[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression node cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Clone fragment #1 returns variables i , while Clone fragment #2 returns variables |