(
self,
tree: MypyFile,
modules: dict[str, MypyFile],
type_map: dict[Expression, Type],
options: Options,
)
| 864 | self.files: list[FileInfo] = [] |
| 865 | |
| 866 | def on_file( |
| 867 | self, |
| 868 | tree: MypyFile, |
| 869 | modules: dict[str, MypyFile], |
| 870 | type_map: dict[Expression, Type], |
| 871 | options: Options, |
| 872 | ) -> None: |
| 873 | try: |
| 874 | path = os.path.relpath(tree.path) |
| 875 | except ValueError: |
| 876 | return |
| 877 | |
| 878 | if should_skip_path(path): |
| 879 | return |
| 880 | |
| 881 | visitor = stats.StatisticsVisitor( |
| 882 | inferred=True, |
| 883 | filename=tree.fullname, |
| 884 | modules=modules, |
| 885 | typemap=type_map, |
| 886 | all_nodes=True, |
| 887 | ) |
| 888 | tree.accept(visitor) |
| 889 | |
| 890 | file_info = FileInfo(path, tree._fullname) |
| 891 | for lineno, _ in iterate_python_lines(path): |
| 892 | status = visitor.line_map.get(lineno, stats.TYPE_EMPTY) |
| 893 | file_info.counts[status] += 1 |
| 894 | |
| 895 | self.files.append(file_info) |
| 896 | |
| 897 | def on_finish(self) -> None: |
| 898 | if not self.files: |
nothing calls this directly
no test coverage detected