Path 1: 1266 calls (0.5)

ImportFrom (651) Import (615)

'typing' (153) 'os' (86) 'collections' (63) 'sys' (56) '__future__' (52) 'abc' (37) 're' (32) 'dataclasses' (29) 'enum' (23) 'collections.abc' (23)

1def check_deprecated_module(self, node: nodes.Import, mod_path: str | None) -> None:
2        """Checks if the module is deprecated."""
3        for mod_name in self.deprecated_modules():
4            if mod_path == mod_name or mod_path and mod_path.startswith(mod_name + "."):
5                self.add_message("deprecated-module", node=node, args=mod_path)
            

Path 2: 1222 calls (0.49)

ImportFrom (632) Import (590)

'typing' (150) 'os' (83) 'collections' (63) 'sys' (54) '__future__' (52) 'abc' (37) 're' (32) 'dataclasses' (29) 'enum' (23) 'collections.abc' (23)

1def check_deprecated_module(self, node: nodes.Import, mod_path: str | None) -> None:
2        """Checks if the module is deprecated."""
3        for mod_name in self.deprecated_modules():
4            if mod_path == mod_name or mod_path and mod_path.startswith(mod_name + "."):
5                self.add_message("deprecated-module", node=node, args=mod_path)
            

Path 3: 19 calls (0.01)

Import (11) ImportFrom (8)

'optparse' (6) 'distutils' (2) 'deprecated' (2) 'uninstalled' (2) 'deprecated_module' (2) 'xml.etree.cElementTree' (1) 'imp' (1) 'distutils.version' (...

1def check_deprecated_module(self, node: nodes.Import, mod_path: str | None) -> None:
2        """Checks if the module is deprecated."""
3        for mod_name in self.deprecated_modules():
4            if mod_path == mod_name or mod_path and mod_path.startswith(mod_name + "."):
5                self.add_message("deprecated-module", node=node, args=mod_path)