File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/junit/JMeterTest.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/junit/JMeterTest.java | |||
Method name: void createFunctionSet()
|
Method name: void createTagSet()
|
|||
Number of AST nodes: 14 | Number of AST nodes: 13 | |||
1 | funcTitles = new HashMap(20);↵ | 1 | guiTags = new HashMap(90);↵ | |
2 | String compref = "../xdocs/usermanual/functions.xml";↵ | 2 | String compref = "../xdocs/usermanual/component_reference.xml";↵ | |
3 | SAXBuilder bldr = new SAXBuilder();↵ | 3 | SAXBuilder bldr = new SAXBuilder();↵ | |
4 | Document doc;↵ | 4 | Document doc;↵ | |
5 | doc = bldr.build(compref);↵ | 5 | doc = bldr.build(compref);↵ | |
6 | Element root = doc.getRootElement();↵ | 6 | Element root = doc.getRootElement();↵ | |
7 | Element body = root.getChild("body");↵ | 7 | Element body = root.getChild("body");↵ | |
8 | Element section = body.getChild("section");↵ | 8 | ↵ | |
9 | List sections = section.getChildren("subsection");↵ | 9 | List sections = body.getChildren("section");↵ | |
10 | for (int i = 0; i < sections.size(); i++) {↵ | 10 | for (int i = 0; i < sections.size(); i++) {↵ | |
11 | List components = ((Element) sections.get(i)).getChildren("component");↵ | 11 | List components = ((Element) sections.get(i)).getChildren("component");↵ | |
12 | for (int j = 0; j < components.size(); j++) {↵ | 12 | for (int j = 0; j < components.size(); j++) {↵ | |
13 | Element comp = (Element) components.get(j);↵ | 13 | Element comp = (Element) components.get(j);↵ | |
14 | funcTitles.put(comp.getAttributeValue("name"), Boolean.FALSE);↵ | 14 | guiTags.put(comp.getAttributeValue("tag"), Boolean.FALSE);↵ | |
15 | }↵ | 15 | }↵ | |
16 | } | 16 |
| |
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 | 59 |
Number of mapped statements | 13 |
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) | 4.7 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | funcTitles = new HashMap(20); |
| 1 | guiTags = new HashMap(90); | |||||||||||||||
2 | String compref = "../xdocs/usermanual/functions.xml"; |
| 2 | String compref = "../xdocs/usermanual/component_reference.xml"; | |||||||||||||||
3 | SAXBuilder bldr = new SAXBuilder(); | 3 | SAXBuilder bldr = new SAXBuilder(); | ||||||||||||||||
4 | Document doc; | 4 | Document doc; | ||||||||||||||||
5 | doc = bldr.build(compref); | 5 | doc = bldr.build(compref); | ||||||||||||||||
6 | Element root = doc.getRootElement(); | 6 | Element root = doc.getRootElement(); | ||||||||||||||||
7 | Element body = root.getChild("body"); | 7 | Element body = root.getChild("body"); | ||||||||||||||||
8 | Element section = body.getChild("section"); |
| | ||||||||||||||||
9 | List sections = section.getChildren("subsection"); |
| 8 | List sections = body.getChildren("section"); | |||||||||||||||
10 | for (int i = 0; i < sections.size(); i++) | 9 | for (int i = 0; i < sections.size(); i++) | ||||||||||||||||
11 | List components = ((Element)sections.get(i)).getChildren("component"); | 10 | List components = ((Element)sections.get(i)).getChildren("component"); | ||||||||||||||||
12 | for (int j = 0; j < components.size(); j++) | 11 | for (int j = 0; j < components.size(); j++) | ||||||||||||||||
13 | Element comp = (Element)components.get(j); | 12 | Element comp = (Element)components.get(j); | ||||||||||||||||
14 | funcTitles.put(comp.getAttributeValue("name"), Boolean.FALSE); |
| 13 | guiTags.put(comp.getAttributeValue("tag"), Boolean.FALSE); |
Row | Violation |
---|---|
1 | Expression funcTitles is a field being modified, and thus it cannot be parameterized |
2 | Expression guiTags is a field being modified, and thus it cannot be parameterized |
3 | Unmatched statement Element section=body.getChild("section"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Expression body cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression funcTitles cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression guiTags cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Clone fragment #1 returns variables body , while Clone fragment #2 returns variables |