File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/parser/XMLContactDocumentParser.java | File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/parser/XMLContactDocumentParser.java | |||
Method name: Iterator getAddressIterator()
|
Method name: Iterator getAddressIterator()
|
|||
Number of AST nodes: 18 | Number of AST nodes: 18 | |||
1 | String poBox = "";↵ | |||
2 | Element e1 = typeElement.getChild(VCARD.ADR_POSTOFFICEBOX);↵ | |||
3 | if (e1 != null)↵ | |||
4 | poBox = e1.getText();↵ | |||
5 | String street = "";↵ | |||
6 | Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS);↵ | |||
7 | if (e2 != null)↵ | |||
8 | street = e2.getText();↵ | |||
1 | String locality = "";↵ | 9 | String locality = "";↵ | |
2 | Element e3 = typeElement.getChild(VCARD.ADR_LOCALITY);↵ | 10 | Element e3 = typeElement.getChild(VCARD.ADR_LOCALITY);↵ | |
3 | if (e3 != null)↵ | 11 | if (e3 != null)↵ | |
4 | locality = e3.getText();↵ | 12 | locality = e3.getText();↵ | |
5 | String postalCode = "";↵ | 13 | String postalCode = "";↵ | |
6 | Element e4 = typeElement.getChild(VCARD.ADR_POSTALCODE);↵ | 14 | Element e4 = typeElement.getChild(VCARD.ADR_POSTALCODE);↵ | |
7 | if (e4 != null)↵ | 15 | if (e4 != null)↵ | |
8 | postalCode = e4.getText();↵ | 16 | postalCode = e4.getText();↵ | |
9 | String region = "";↵ | 17 | String region = "";↵ | |
10 | Element e5 = typeElement.getChild(VCARD.ADR_REGION);↵ | 18 |
| |
11 | if (e5 != null)↵ | |||
12 | region = e5.getText();↵ | |||
13 | String country = "";↵ | |||
14 | Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY);↵ | |||
15 | if (e6 != null)↵ | |||
16 | country = e6.getText();↵ | |||
17 | String label = "";↵ | |||
18 | Element e7 = typeElement.getChild(VCARD.LABEL); | |||
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.9 |
Clones location | Clones are in the same method |
Number of node comparisons | 147 |
Number of mapped statements | 18 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 6.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
16 | String locality = ""; | 16 | String locality = ""; | ||||||||||||||||||
17 | Element e3 = typeElement.getChild(VCARD.ADR_LOCALITY); | 17 | Element e3 = typeElement.getChild(VCARD.ADR_LOCALITY); | ||||||||||||||||||
18 | if (e3 != null) | 18 | if (e3 != null) | ||||||||||||||||||
19 | locality = e3.getText(); | 19 | locality = e3.getText(); | ||||||||||||||||||
20 | String postalCode = ""; | 20 | String postalCode = ""; | ||||||||||||||||||
21 | Element e4 = typeElement.getChild(VCARD.ADR_POSTALCODE); | 21 | Element e4 = typeElement.getChild(VCARD.ADR_POSTALCODE); | ||||||||||||||||||
22 | if (e4 != null) | 22 | if (e4 != null) | ||||||||||||||||||
23 | postalCode = e4.getText(); | 23 | postalCode = e4.getText(); | ||||||||||||||||||
24 | String region = ""; | 24 | String region = ""; | ||||||||||||||||||
25 | Element e5 = typeElement.getChild(VCARD.ADR_REGION); | 25 | Element e5 = typeElement.getChild(VCARD.ADR_REGION); | ||||||||||||||||||
26 | if (e5 != null) |
| 14 | if (e2 != null) | |||||||||||||||||
27 | region = e5.getText(); |
| 15 | street = e2.getText(); | |||||||||||||||||
28 | String country = ""; |
| 8 | String poBox = ""; | |||||||||||||||||
29 | Element e6 = typeElement.getChild(VCARD.ADR_COUNTRY); |
| 9 | Element e1 = typeElement.getChild(VCARD.ADR_POSTOFFICEBOX); | |||||||||||||||||
30 | if (e6 != null) |
| 10 | if (e1 != null) | |||||||||||||||||
31 | country = e6.getText(); |
| 11 | poBox = e1.getText(); | |||||||||||||||||
32 | String label = ""; |
| 12 | String street = ""; | |||||||||||||||||
33 | Element e7 = typeElement.getChild(VCARD.LABEL); |
| 13 | Element e2 = typeElement.getChild(VCARD.ADR_STREETADDRESS); |
Row | Violation |
---|---|
1 | Expression e5 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression e2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression region cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression street cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression e5 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression e2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression street cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression e2 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Clone fragment #1 returns variables e7, label, locality, postalCode, region, country , while Clone fragment #2 returns variables e5, region, poBox, street, locality, postalCode |