| Conditions | 5 |
| Total Lines | 14 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | """ |
||
| 23 | 1 | def extract_referred_nodes(tree_with_refs, tree_with_ids, attrname): |
|
| 24 | 1 | reflist = [] |
|
| 25 | 1 | elementlist = [] |
|
| 26 | |||
| 27 | 1 | for element in tree_with_refs.getiterator(): |
|
| 28 | 1 | value = element.get(attrname) |
|
| 29 | 1 | if value is not None: |
|
| 30 | 1 | reflist.append(value) |
|
| 31 | |||
| 32 | 1 | for element in tree_with_ids.getiterator(): |
|
| 33 | 1 | if element.get("id") in reflist: |
|
| 34 | 1 | elementlist.append(element) |
|
| 35 | |||
| 36 | return elementlist |
||
| 37 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.