Method: pylint.checkers.base.name_checker.checker.NameChecker.visit_functiondef
Calls: 3512, Exceptions: 0, Paths: 4Back
Path 1: 1795 calls (0.51)
FunctionDef (1758) AsyncFunctionDef (37)
1@utils.only_required_for_messages("disallowed-name", "invalid-name")
2 def visit_functiondef(self, node: nodes.FunctionDef) -> None:
3 # Do not emit any warnings if the method is just an implementation
4 # of a base class method.
5 confidence = interfaces.HIGH
6 if node.is_method():
7 if utils.overrides_a_method(node.parent.frame(future=True), node.name):
8 return
9 confidence = (
10 interfaces.INFERENCE
11 if utils.has_known_bases(node.parent.frame(future=True))
12 else interfaces.INFERENCE_FAILURE
13 )
14
15 self._check_name(
16 _determine_function_name_type(node, config=self.linter.config),
17 node.name,
18 node,
19 confidence,
20 )
21 # Check argument names
22 args = node.args.args
23 if args is not None:
24 self._recursive_check_names(args)
Path 2: 1433 calls (0.41)
FunctionDef (1419) AsyncFunctionDef (14)
1@utils.only_required_for_messages("disallowed-name", "invalid-name")
2 def visit_functiondef(self, node: nodes.FunctionDef) -> None:
3 # Do not emit any warnings if the method is just an implementation
4 # of a base class method.
5 confidence = interfaces.HIGH
6 if node.is_method():
7 if utils.overrides_a_method(node.parent.frame(future=True), node.name):
8 return
9 confidence = (
10 interfaces.INFERENCE
11 if utils.has_known_bases(node.parent.frame(future=True))
12 else interfaces.INFERENCE_FAILURE
13 )
14
15 self._check_name(
16 _determine_function_name_type(node, config=self.linter.config),
17 node.name,
18 node,
19 confidence,
20 )
21 # Check argument names
22 args = node.args.args
23 if args is not None:
24 self._recursive_check_names(args)
Path 3: 257 calls (0.07)
FunctionDef (254) AsyncFunctionDef (3)
None (257)
1@utils.only_required_for_messages("disallowed-name", "invalid-name")
2 def visit_functiondef(self, node: nodes.FunctionDef) -> None:
3 # Do not emit any warnings if the method is just an implementation
4 # of a base class method.
5 confidence = interfaces.HIGH
6 if node.is_method():
7 if utils.overrides_a_method(node.parent.frame(future=True), node.name):
8 return
9 confidence = (
10 interfaces.INFERENCE
11 if utils.has_known_bases(node.parent.frame(future=True))
12 else interfaces.INFERENCE_FAILURE
13 )
14
15 self._check_name(
16 _determine_function_name_type(node, config=self.linter.config),
17 node.name,
18 node,
19 confidence,
20 )
21 # Check argument names
22 args = node.args.args
23 if args is not None:
24 self._recursive_check_names(args)
Path 4: 27 calls (0.01)
FunctionDef (27)
1@utils.only_required_for_messages("disallowed-name", "invalid-name")
2 def visit_functiondef(self, node: nodes.FunctionDef) -> None:
3 # Do not emit any warnings if the method is just an implementation
4 # of a base class method.
5 confidence = interfaces.HIGH
6 if node.is_method():
7 if utils.overrides_a_method(node.parent.frame(future=True), node.name):
8 return
9 confidence = (
10 interfaces.INFERENCE
11 if utils.has_known_bases(node.parent.frame(future=True))
12 else interfaces.INFERENCE_FAILURE
13 )
14
15 self._check_name(
16 _determine_function_name_type(node, config=self.linter.config),
17 node.name,
18 node,
19 confidence,
20 )
21 # Check argument names
22 args = node.args.args
23 if args is not None:
24 self._recursive_check_names(args)