String variables are when variable.points_to is a string This happens ONLY when we have imports that we delayed processing for This function looks through all files to see if any particular node matches the variable.points_to string :param Variable variable: :param list[Gr
(variable, file_groups)
| 62 | |
| 63 | |
| 64 | def _resolve_str_variable(variable, file_groups): |
| 65 | """ |
| 66 | String variables are when variable.points_to is a string |
| 67 | This happens ONLY when we have imports that we delayed processing for |
| 68 | |
| 69 | This function looks through all files to see if any particular node matches |
| 70 | the variable.points_to string |
| 71 | |
| 72 | :param Variable variable: |
| 73 | :param list[Group] file_groups: |
| 74 | :rtype: Node|Group|str |
| 75 | """ |
| 76 | for file_group in file_groups: |
| 77 | for node in file_group.all_nodes(): |
| 78 | if any(ot == variable.points_to for ot in node.import_tokens): |
| 79 | return node |
| 80 | for group in file_group.all_groups(): |
| 81 | if any(ot == variable.points_to for ot in group.import_tokens): |
| 82 | return group |
| 83 | return OWNER_CONST.UNKNOWN_MODULE |
| 84 | |
| 85 | |
| 86 | class BaseLanguage(abc.ABC): |
no test coverage detected