Method: pylint.checkers.deprecated.DeprecatedMixin.check_deprecated_method
Calls: 11185, Exceptions: 8, Paths: 14Back
Path 1: 7494 calls (0.67)
Call (7494)
FunctionDef (4124) ClassDef (3308) AsyncFunctionDef (40) BoundMethod (20) PartialFunction (2)
1def check_deprecated_method(self, node: nodes.Call, inferred: nodes.NodeNG) -> None:
2 """Executes the checker for the given node.
3
4 This method should be called from the checker implementing this mixin.
5 """
6
7 # Reject nodes which aren't of interest to us.
8 if not isinstance(inferred, ACCEPTABLE_NODES):
9 return
10
11 if isinstance(node.func, nodes.Attribute):
12 func_name = node.func.attrname
13 elif isinstance(node.func, nodes.Name):
14 func_name = node.func.name
15 else:
16 # Not interested in other nodes.
17 return
18
19 qnames = {inferred.qname(), func_name}
20 if any(name in self.deprecated_methods() for name in qnames):
21 self.add_message("deprecated-method", node=node, args=(func_name,))
22 return
23 num_of_args = len(node.args)
24 kwargs = {kw.arg for kw in node.keywords} if node.keywords else {}
25 deprecated_arguments = (self.deprecated_arguments(qn) for qn in qnames)
26 for position, arg_name in chain(*deprecated_arguments):
27 if arg_name in kwargs:
28 # function was called with deprecated argument as keyword argument
29 self.add_message(
30 "deprecated-argument", node=node, args=(arg_name, func_name)
31 )
32 elif position is not None and position < num_of_args:
33 # function was called with deprecated argument as positional argument
34 self.add_message(
35 "deprecated-argument", node=node, args=(arg_name, func_name)
36 )
Path 2: 2965 calls (0.27)
Call (2965)
BoundMethod (1745) FunctionDef (907) ClassDef (212) UnboundMethod (80) AsyncFunctionDef (9) ClassModel.attr___subclasses__.
1def check_deprecated_method(self, node: nodes.Call, inferred: nodes.NodeNG) -> None:
2 """Executes the checker for the given node.
3
4 This method should be called from the checker implementing this mixin.
5 """
6
7 # Reject nodes which aren't of interest to us.
8 if not isinstance(inferred, ACCEPTABLE_NODES):
9 return
10
11 if isinstance(node.func, nodes.Attribute):
12 func_name = node.func.attrname
13 elif isinstance(node.func, nodes.Name):
14 func_name = node.func.name
15 else:
16 # Not interested in other nodes.
17 return
18
19 qnames = {inferred.qname(), func_name}
20 if any(name in self.deprecated_methods() for name in qnames):
21 self.add_message("deprecated-method", node=node, args=(func_name,))
22 return
23 num_of_args = len(node.args)
24 kwargs = {kw.arg for kw in node.keywords} if node.keywords else {}
25 deprecated_arguments = (self.deprecated_arguments(qn) for qn in qnames)
26 for position, arg_name in chain(*deprecated_arguments):
27 if arg_name in kwargs:
28 # function was called with deprecated argument as keyword argument
29 self.add_message(
30 "deprecated-argument", node=node, args=(arg_name, func_name)
31 )
32 elif position is not None and position < num_of_args:
33 # function was called with deprecated argument as positional argument
34 self.add_message(
35 "deprecated-argument", node=node, args=(arg_name, func_name)
36 )
Path 3: 596 calls (0.05)
Call (596)
Uninferable (321) Lambda (168) Instance (50) Const (44) Slice (4) Module (2) List (2) Dict (2) Tuple (2) AssignAttr (1)
None (596)
1def check_deprecated_method(self, node: nodes.Call, inferred: nodes.NodeNG) -> None:
2 """Executes the checker for the given node.
3
4 This method should be called from the checker implementing this mixin.
5 """
6
7 # Reject nodes which aren't of interest to us.
8 if not isinstance(inferred, ACCEPTABLE_NODES):
9 return
10
11 if isinstance(node.func, nodes.Attribute):
12 func_name = node.func.attrname
13 elif isinstance(node.func, nodes.Name):
14 func_name = node.func.name
15 else:
16 # Not interested in other nodes.
17 return
18
19 qnames = {inferred.qname(), func_name}
20 if any(name in self.deprecated_methods() for name in qnames):
21 self.add_message("deprecated-method", node=node, args=(func_name,))
22 return
23 num_of_args = len(node.args)
24 kwargs = {kw.arg for kw in node.keywords} if node.keywords else {}
25 deprecated_arguments = (self.deprecated_arguments(qn) for qn in qnames)
26 for position, arg_name in chain(*deprecated_arguments):
27 if arg_name in kwargs:
28 # function was called with deprecated argument as keyword argument
29 self.add_message(
30 "deprecated-argument", node=node, args=(arg_name, func_name)
31 )
32 elif position is not None and position < num_of_args:
33 # function was called with deprecated argument as positional argument
34 self.add_message(
35 "deprecated-argument", node=node, args=(arg_name, func_name)
36 )
Path 4: 53 calls (0.0)
Call (53)
ClassDef (52) FunctionDef (1)
1def check_deprecated_method(self, node: nodes.Call, inferred: nodes.NodeNG) -> None:
2 """Executes the checker for the given node.
3
4 This method should be called from the checker implementing this mixin.
5 """
6
7 # Reject nodes which aren't of interest to us.
8 if not isinstance(inferred, ACCEPTABLE_NODES):
9 return
10
11 if isinstance(node.func, nodes.Attribute):
12 func_name = node.func.attrname
13 elif isinstance(node.func, nodes.Name):
14 func_name = node.func.name
15 else:
16 # Not interested in other nodes.
17 return
18
19 qnames = {inferred.qname(), func_name}
20 if any(name in self.deprecated_methods() for name in qnames):
21 self.add_message("deprecated-method", node=node, args=(func_name,))
22 return
23 num_of_args = len(node.args)
24 kwargs = {kw.arg for kw in node.keywords} if node.keywords else {}
25 deprecated_arguments = (self.deprecated_arguments(qn) for qn in qnames)
26 for position, arg_name in chain(*deprecated_arguments):
27 if arg_name in kwargs:
28 # function was called with deprecated argument as keyword argument
29 self.add_message(
30 "deprecated-argument", node=node, args=(arg_name, func_name)
31 )
32 elif position is not None and position < num_of_args:
33 # function was called with deprecated argument as positional argument
34 self.add_message(
35 "deprecated-argument", node=node, args=(arg_name, func_name)
36 )
Path 5: 46 calls (0.0)
Call (46)
PartialFunction (24) ClassDef (20) BoundMethod (2)
None (46)
1def check_deprecated_method(self, node: nodes.Call, inferred: nodes.NodeNG) -> None:
2 """Executes the checker for the given node.
3
4 This method should be called from the checker implementing this mixin.
5 """
6
7 # Reject nodes which aren't of interest to us.
8 if not isinstance(inferred, ACCEPTABLE_NODES):
9 return
10
11 if isinstance(node.func, nodes.Attribute):
12 func_name = node.func.attrname
13 elif isinstance(node.func, nodes.Name):
14 func_name = node.func.name
15 else:
16 # Not interested in other nodes.
17 return
18
19 qnames = {inferred.qname(), func_name}
20 if any(name in self.deprecated_methods() for name in qnames):
21 self.add_message("deprecated-method", node=node, args=(func_name,))
22 return
23 num_of_args = len(node.args)
24 kwargs = {kw.arg for kw in node.keywords} if node.keywords else {}
25 deprecated_arguments = (self.deprecated_arguments(qn) for qn in qnames)
26 for position, arg_name in chain(*deprecated_arguments):
27 if arg_name in kwargs:
28 # function was called with deprecated argument as keyword argument
29 self.add_message(
30 "deprecated-argument", node=node, args=(arg_name, func_name)
31 )
32 elif position is not None and position < num_of_args:
33 # function was called with deprecated argument as positional argument
34 self.add_message(
35 "deprecated-argument", node=node, args=(arg_name, func_name)
36 )
Path 6: 12 calls (0.0)
Call (12)
AsyncFunctionDef (7) BoundMethod (3) FunctionDef (2)
1def check_deprecated_method(self, node: nodes.Call, inferred: nodes.NodeNG) -> None:
2 """Executes the checker for the given node.
3
4 This method should be called from the checker implementing this mixin.
5 """
6
7 # Reject nodes which aren't of interest to us.
8 if not isinstance(inferred, ACCEPTABLE_NODES):
9 return
10
11 if isinstance(node.func, nodes.Attribute):
12 func_name = node.func.attrname
13 elif isinstance(node.func, nodes.Name):
14 func_name = node.func.name
15 else:
16 # Not interested in other nodes.
17 return
18
19 qnames = {inferred.qname(), func_name}
20 if any(name in self.deprecated_methods() for name in qnames):
21 self.add_message("deprecated-method", node=node, args=(func_name,))
22 return
23 num_of_args = len(node.args)
24 kwargs = {kw.arg for kw in node.keywords} if node.keywords else {}
25 deprecated_arguments = (self.deprecated_arguments(qn) for qn in qnames)
26 for position, arg_name in chain(*deprecated_arguments):
27 if arg_name in kwargs:
28 # function was called with deprecated argument as keyword argument
29 self.add_message(
30 "deprecated-argument", node=node, args=(arg_name, func_name)
31 )
32 elif position is not None and position < num_of_args:
33 # function was called with deprecated argument as positional argument
34 self.add_message(
35 "deprecated-argument", node=node, args=(arg_name, func_name)
36 )
Path 7: 7 calls (0.0)
Call (7)
BoundMethod (4) FunctionDef (3)
None (7)
GeneratorExit (7)
1def check_deprecated_method(self, node: nodes.Call, inferred: nodes.NodeNG) -> None:
2 """Executes the checker for the given node.
3
4 This method should be called from the checker implementing this mixin.
5 """
6
7 # Reject nodes which aren't of interest to us.
8 if not isinstance(inferred, ACCEPTABLE_NODES):
9 return
10
11 if isinstance(node.func, nodes.Attribute):
12 func_name = node.func.attrname
13 elif isinstance(node.func, nodes.Name):
14 func_name = node.func.name
15 else:
16 # Not interested in other nodes.
17 return
18
19 qnames = {inferred.qname(), func_name}
20 if any(name in self.deprecated_methods() for name in qnames):
21 self.add_message("deprecated-method", node=node, args=(func_name,))
22 return
23 num_of_args = len(node.args)
24 kwargs = {kw.arg for kw in node.keywords} if node.keywords else {}
25 deprecated_arguments = (self.deprecated_arguments(qn) for qn in qnames)
26 for position, arg_name in chain(*deprecated_arguments):
27 if arg_name in kwargs:
28 # function was called with deprecated argument as keyword argument
29 self.add_message(
30 "deprecated-argument", node=node, args=(arg_name, func_name)
31 )
32 elif position is not None and position < num_of_args:
33 # function was called with deprecated argument as positional argument
34 self.add_message(
35 "deprecated-argument", node=node, args=(arg_name, func_name)
36 )
Path 8: 3 calls (0.0)
Call (3)
FunctionDef (3)
1def check_deprecated_method(self, node: nodes.Call, inferred: nodes.NodeNG) -> None:
2 """Executes the checker for the given node.
3
4 This method should be called from the checker implementing this mixin.
5 """
6
7 # Reject nodes which aren't of interest to us.
8 if not isinstance(inferred, ACCEPTABLE_NODES):
9 return
10
11 if isinstance(node.func, nodes.Attribute):
12 func_name = node.func.attrname
13 elif isinstance(node.func, nodes.Name):
14 func_name = node.func.name
15 else:
16 # Not interested in other nodes.
17 return
18
19 qnames = {inferred.qname(), func_name}
20 if any(name in self.deprecated_methods() for name in qnames):
21 self.add_message("deprecated-method", node=node, args=(func_name,))
22 return
23 num_of_args = len(node.args)
24 kwargs = {kw.arg for kw in node.keywords} if node.keywords else {}
25 deprecated_arguments = (self.deprecated_arguments(qn) for qn in qnames)
26 for position, arg_name in chain(*deprecated_arguments):
27 if arg_name in kwargs:
28 # function was called with deprecated argument as keyword argument
29 self.add_message(
30 "deprecated-argument", node=node, args=(arg_name, func_name)
31 )
32 elif position is not None and position < num_of_args:
33 # function was called with deprecated argument as positional argument
34 self.add_message(
35 "deprecated-argument", node=node, args=(arg_name, func_name)
36 )
Path 9: 3 calls (0.0)
Call (3)
BoundMethod (3)
1def check_deprecated_method(self, node: nodes.Call, inferred: nodes.NodeNG) -> None:
2 """Executes the checker for the given node.
3
4 This method should be called from the checker implementing this mixin.
5 """
6
7 # Reject nodes which aren't of interest to us.
8 if not isinstance(inferred, ACCEPTABLE_NODES):
9 return
10
11 if isinstance(node.func, nodes.Attribute):
12 func_name = node.func.attrname
13 elif isinstance(node.func, nodes.Name):
14 func_name = node.func.name
15 else:
16 # Not interested in other nodes.
17 return
18
19 qnames = {inferred.qname(), func_name}
20 if any(name in self.deprecated_methods() for name in qnames):
21 self.add_message("deprecated-method", node=node, args=(func_name,))
22 return
23 num_of_args = len(node.args)
24 kwargs = {kw.arg for kw in node.keywords} if node.keywords else {}
25 deprecated_arguments = (self.deprecated_arguments(qn) for qn in qnames)
26 for position, arg_name in chain(*deprecated_arguments):
27 if arg_name in kwargs:
28 # function was called with deprecated argument as keyword argument
29 self.add_message(
30 "deprecated-argument", node=node, args=(arg_name, func_name)
31 )
32 elif position is not None and position < num_of_args:
33 # function was called with deprecated argument as positional argument
34 self.add_message(
35 "deprecated-argument", node=node, args=(arg_name, func_name)
36 )
Path 10: 2 calls (0.0)
Call (2)
FunctionDef (1) ClassDef (1)
1def check_deprecated_method(self, node: nodes.Call, inferred: nodes.NodeNG) -> None:
2 """Executes the checker for the given node.
3
4 This method should be called from the checker implementing this mixin.
5 """
6
7 # Reject nodes which aren't of interest to us.
8 if not isinstance(inferred, ACCEPTABLE_NODES):
9 return
10
11 if isinstance(node.func, nodes.Attribute):
12 func_name = node.func.attrname
13 elif isinstance(node.func, nodes.Name):
14 func_name = node.func.name
15 else:
16 # Not interested in other nodes.
17 return
18
19 qnames = {inferred.qname(), func_name}
20 if any(name in self.deprecated_methods() for name in qnames):
21 self.add_message("deprecated-method", node=node, args=(func_name,))
22 return
23 num_of_args = len(node.args)
24 kwargs = {kw.arg for kw in node.keywords} if node.keywords else {}
25 deprecated_arguments = (self.deprecated_arguments(qn) for qn in qnames)
26 for position, arg_name in chain(*deprecated_arguments):
27 if arg_name in kwargs:
28 # function was called with deprecated argument as keyword argument
29 self.add_message(
30 "deprecated-argument", node=node, args=(arg_name, func_name)
31 )
32 elif position is not None and position < num_of_args:
33 # function was called with deprecated argument as positional argument
34 self.add_message(
35 "deprecated-argument", node=node, args=(arg_name, func_name)
36 )
Path 11: 1 calls (0.0)
Call (1)
FunctionDef (1)
None (1)
GeneratorExit (1)
1def check_deprecated_method(self, node: nodes.Call, inferred: nodes.NodeNG) -> None:
2 """Executes the checker for the given node.
3
4 This method should be called from the checker implementing this mixin.
5 """
6
7 # Reject nodes which aren't of interest to us.
8 if not isinstance(inferred, ACCEPTABLE_NODES):
9 return
10
11 if isinstance(node.func, nodes.Attribute):
12 func_name = node.func.attrname
13 elif isinstance(node.func, nodes.Name):
14 func_name = node.func.name
15 else:
16 # Not interested in other nodes.
17 return
18
19 qnames = {inferred.qname(), func_name}
20 if any(name in self.deprecated_methods() for name in qnames):
21 self.add_message("deprecated-method", node=node, args=(func_name,))
22 return
23 num_of_args = len(node.args)
24 kwargs = {kw.arg for kw in node.keywords} if node.keywords else {}
25 deprecated_arguments = (self.deprecated_arguments(qn) for qn in qnames)
26 for position, arg_name in chain(*deprecated_arguments):
27 if arg_name in kwargs:
28 # function was called with deprecated argument as keyword argument
29 self.add_message(
30 "deprecated-argument", node=node, args=(arg_name, func_name)
31 )
32 elif position is not None and position < num_of_args:
33 # function was called with deprecated argument as positional argument
34 self.add_message(
35 "deprecated-argument", node=node, args=(arg_name, func_name)
36 )
Path 12: 1 calls (0.0)
Call (1)
BoundMethod (1)
1def check_deprecated_method(self, node: nodes.Call, inferred: nodes.NodeNG) -> None:
2 """Executes the checker for the given node.
3
4 This method should be called from the checker implementing this mixin.
5 """
6
7 # Reject nodes which aren't of interest to us.
8 if not isinstance(inferred, ACCEPTABLE_NODES):
9 return
10
11 if isinstance(node.func, nodes.Attribute):
12 func_name = node.func.attrname
13 elif isinstance(node.func, nodes.Name):
14 func_name = node.func.name
15 else:
16 # Not interested in other nodes.
17 return
18
19 qnames = {inferred.qname(), func_name}
20 if any(name in self.deprecated_methods() for name in qnames):
21 self.add_message("deprecated-method", node=node, args=(func_name,))
22 return
23 num_of_args = len(node.args)
24 kwargs = {kw.arg for kw in node.keywords} if node.keywords else {}
25 deprecated_arguments = (self.deprecated_arguments(qn) for qn in qnames)
26 for position, arg_name in chain(*deprecated_arguments):
27 if arg_name in kwargs:
28 # function was called with deprecated argument as keyword argument
29 self.add_message(
30 "deprecated-argument", node=node, args=(arg_name, func_name)
31 )
32 elif position is not None and position < num_of_args:
33 # function was called with deprecated argument as positional argument
34 self.add_message(
35 "deprecated-argument", node=node, args=(arg_name, func_name)
36 )
Path 13: 1 calls (0.0)
Call (1)
FunctionDef (1)
1def check_deprecated_method(self, node: nodes.Call, inferred: nodes.NodeNG) -> None:
2 """Executes the checker for the given node.
3
4 This method should be called from the checker implementing this mixin.
5 """
6
7 # Reject nodes which aren't of interest to us.
8 if not isinstance(inferred, ACCEPTABLE_NODES):
9 return
10
11 if isinstance(node.func, nodes.Attribute):
12 func_name = node.func.attrname
13 elif isinstance(node.func, nodes.Name):
14 func_name = node.func.name
15 else:
16 # Not interested in other nodes.
17 return
18
19 qnames = {inferred.qname(), func_name}
20 if any(name in self.deprecated_methods() for name in qnames):
21 self.add_message("deprecated-method", node=node, args=(func_name,))
22 return
23 num_of_args = len(node.args)
24 kwargs = {kw.arg for kw in node.keywords} if node.keywords else {}
25 deprecated_arguments = (self.deprecated_arguments(qn) for qn in qnames)
26 for position, arg_name in chain(*deprecated_arguments):
27 if arg_name in kwargs:
28 # function was called with deprecated argument as keyword argument
29 self.add_message(
30 "deprecated-argument", node=node, args=(arg_name, func_name)
31 )
32 elif position is not None and position < num_of_args:
33 # function was called with deprecated argument as positional argument
34 self.add_message(
35 "deprecated-argument", node=node, args=(arg_name, func_name)
36 )
Path 14: 1 calls (0.0)
Call (1)
BoundMethod (1)
1def check_deprecated_method(self, node: nodes.Call, inferred: nodes.NodeNG) -> None:
2 """Executes the checker for the given node.
3
4 This method should be called from the checker implementing this mixin.
5 """
6
7 # Reject nodes which aren't of interest to us.
8 if not isinstance(inferred, ACCEPTABLE_NODES):
9 return
10
11 if isinstance(node.func, nodes.Attribute):
12 func_name = node.func.attrname
13 elif isinstance(node.func, nodes.Name):
14 func_name = node.func.name
15 else:
16 # Not interested in other nodes.
17 return
18
19 qnames = {inferred.qname(), func_name}
20 if any(name in self.deprecated_methods() for name in qnames):
21 self.add_message("deprecated-method", node=node, args=(func_name,))
22 return
23 num_of_args = len(node.args)
24 kwargs = {kw.arg for kw in node.keywords} if node.keywords else {}
25 deprecated_arguments = (self.deprecated_arguments(qn) for qn in qnames)
26 for position, arg_name in chain(*deprecated_arguments):
27 if arg_name in kwargs:
28 # function was called with deprecated argument as keyword argument
29 self.add_message(
30 "deprecated-argument", node=node, args=(arg_name, func_name)
31 )
32 elif position is not None and position < num_of_args:
33 # function was called with deprecated argument as positional argument
34 self.add_message(
35 "deprecated-argument", node=node, args=(arg_name, func_name)
36 )