Method: pylint.checkers.variables.VariablesChecker.leave_module
Calls: 1135, Exceptions: 0, Paths: 4Back
Path 1: 1074 calls (0.95)
Module (1074)
1@utils.only_required_for_messages(
2 "unused-import",
3 "unused-wildcard-import",
4 "redefined-builtin",
5 "undefined-all-variable",
6 "invalid-all-object",
7 "invalid-all-format",
8 "unused-variable",
9 "undefined-variable",
10 )
11 def leave_module(self, node: nodes.Module) -> None:
12 """Leave module: check globals."""
13 assert len(self._to_consume) == 1
14
15 self._check_metaclasses(node)
16 not_consumed = self._to_consume.pop().to_consume
17 # attempt to check for __all__ if defined
18 if "__all__" in node.locals:
19 self._check_all(node, not_consumed)
20
21 # check for unused globals
22 self._check_globals(not_consumed)
23
24 # don't check unused imports in __init__ files
25 if not self.linter.config.init_import and node.package:
26 return
27
28 self._check_imports(not_consumed)
29 self._type_annotation_names = []
Path 2: 47 calls (0.04)
Module (47)
None (47)
1@utils.only_required_for_messages(
2 "unused-import",
3 "unused-wildcard-import",
4 "redefined-builtin",
5 "undefined-all-variable",
6 "invalid-all-object",
7 "invalid-all-format",
8 "unused-variable",
9 "undefined-variable",
10 )
11 def leave_module(self, node: nodes.Module) -> None:
12 """Leave module: check globals."""
13 assert len(self._to_consume) == 1
14
15 self._check_metaclasses(node)
16 not_consumed = self._to_consume.pop().to_consume
17 # attempt to check for __all__ if defined
18 if "__all__" in node.locals:
19 self._check_all(node, not_consumed)
20
21 # check for unused globals
22 self._check_globals(not_consumed)
23
24 # don't check unused imports in __init__ files
25 if not self.linter.config.init_import and node.package:
26 return
27
28 self._check_imports(not_consumed)
29 self._type_annotation_names = []
Path 3: 12 calls (0.01)
Module (12)
1@utils.only_required_for_messages(
2 "unused-import",
3 "unused-wildcard-import",
4 "redefined-builtin",
5 "undefined-all-variable",
6 "invalid-all-object",
7 "invalid-all-format",
8 "unused-variable",
9 "undefined-variable",
10 )
11 def leave_module(self, node: nodes.Module) -> None:
12 """Leave module: check globals."""
13 assert len(self._to_consume) == 1
14
15 self._check_metaclasses(node)
16 not_consumed = self._to_consume.pop().to_consume
17 # attempt to check for __all__ if defined
18 if "__all__" in node.locals:
19 self._check_all(node, not_consumed)
20
21 # check for unused globals
22 self._check_globals(not_consumed)
23
24 # don't check unused imports in __init__ files
25 if not self.linter.config.init_import and node.package:
26 return
27
28 self._check_imports(not_consumed)
29 self._type_annotation_names = []
Path 4: 2 calls (0.0)
Module (2)
None (2)
1@utils.only_required_for_messages(
2 "unused-import",
3 "unused-wildcard-import",
4 "redefined-builtin",
5 "undefined-all-variable",
6 "invalid-all-object",
7 "invalid-all-format",
8 "unused-variable",
9 "undefined-variable",
10 )
11 def leave_module(self, node: nodes.Module) -> None:
12 """Leave module: check globals."""
13 assert len(self._to_consume) == 1
14
15 self._check_metaclasses(node)
16 not_consumed = self._to_consume.pop().to_consume
17 # attempt to check for __all__ if defined
18 if "__all__" in node.locals:
19 self._check_all(node, not_consumed)
20
21 # check for unused globals
22 self._check_globals(not_consumed)
23
24 # don't check unused imports in __init__ files
25 if not self.linter.config.init_import and node.package:
26 return
27
28 self._check_imports(not_consumed)
29 self._type_annotation_names = []