Exclude nodes (functions) which match any of the exclude_functions :param list[Group] file_groups: :param list exclude_functions: :param list include_only_functions: :rtype: list[Group]
(file_groups, exclude_functions, include_only_functions)
| 611 | |
| 612 | |
| 613 | def _limit_functions(file_groups, exclude_functions, include_only_functions): |
| 614 | """ |
| 615 | Exclude nodes (functions) which match any of the exclude_functions |
| 616 | |
| 617 | :param list[Group] file_groups: |
| 618 | :param list exclude_functions: |
| 619 | :param list include_only_functions: |
| 620 | :rtype: list[Group] |
| 621 | """ |
| 622 | |
| 623 | removed_functions = set() |
| 624 | |
| 625 | for group in list(file_groups): |
| 626 | for node in group.all_nodes(): |
| 627 | if node.token in exclude_functions or \ |
| 628 | (include_only_functions and node.token not in include_only_functions): |
| 629 | node.remove_from_parent() |
| 630 | removed_functions.add(node.token) |
| 631 | |
| 632 | for function_name in exclude_functions: |
| 633 | if function_name not in removed_functions: |
| 634 | logging.warning(f"Could not exclude function '{function_name}' " |
| 635 | "because it was not found.") |
| 636 | return file_groups |
| 637 | |
| 638 | |
| 639 | def _generate_graphviz(output_file, extension, final_img_filename): |
no test coverage detected