Method: pylint.extensions.docparams.DocstringParameterChecker._compare_missing_args
Calls: 250, Exceptions: 0, Paths: 3Back
Path 1: 173 calls (0.69)
{'named_arg'} (39) {'doc_type'} (20) {'arg'} (12) set() (11) {'par1'} (6) {'x', 'y', 'z'} (5) {'zarg', 'warg', 'yarg', 'xarg'} (5) {'_some_private_par...
'missing-type-doc' (90) 'missing-param-doc' (83)
{'self', 'cls'} (126) {'self', 'cls', '*args'} (12) {'self', 'cls', '**kwargs'} (11) {'self', '_some_private_param', 'cls'} (6) {'self', '_new', 'cls'...
{'named_arg'} (20) {'self', 'doc_type'} (20) {'**kwargs', 'named_arg'} (15) {'*args', 'named_arg'} (11) {'par1'} (9) {'self'} (8) {'_some_private_para...
FunctionDef (171) ClassDef (2)
1def _compare_missing_args(
2 self,
3 found_argument_names: set[str],
4 message_id: str,
5 not_needed_names: set[str],
6 expected_argument_names: set[str],
7 warning_node: nodes.NodeNG,
8 ) -> None:
9 """Compare the found argument names with the expected ones and
10 generate a message if there are arguments missing.
11
12 :param found_argument_names: argument names found in the docstring
13
14 :param message_id: pylint message id
15
16 :param not_needed_names: names that may be omitted
17
18 :param expected_argument_names: Expected argument names
19
20 :param warning_node: The node to be analyzed
21 """
22 potential_missing_argument_names = (
23 expected_argument_names - found_argument_names
24 ) - not_needed_names
25
26 # Handle variadic and keyword args without asterisks
27 missing_argument_names = set()
28 for name in potential_missing_argument_names:
29 if name.replace("*", "") in found_argument_names:
30 continue
31 missing_argument_names.add(name)
32
33 if missing_argument_names:
34 self.add_message(
35 message_id,
36 args=(", ".join(sorted(missing_argument_names)),),
37 node=warning_node,
38 confidence=HIGH,
39 )
Path 2: 73 calls (0.29)
set() (22) {'y'} (12) {'named_arg'} (8) {'xarg1', 'yarg', 'zarg1'} (5) {'arg1'} (3) {'arg1', 'arg2'} (3) {'x', 'z'} (3) {'z'} (3) {'x'} (3) {'arg1', '...
'missing-param-doc' (38) 'missing-type-doc' (35)
{'self', 'cls'} (72) {'self', 'cls', '*args'} (1)
{'self', 'x', 'y'} (30) {'arg1', 'arg3', 'arg2'} (7) {'x', 'y', 'z'} (7) {'zarg', 'yarg', 'xarg'} (6) {'*args', 'named_arg'} (4) {'**kwargs', 'named_a...
FunctionDef (61) ClassDef (12)
1def _compare_missing_args(
2 self,
3 found_argument_names: set[str],
4 message_id: str,
5 not_needed_names: set[str],
6 expected_argument_names: set[str],
7 warning_node: nodes.NodeNG,
8 ) -> None:
9 """Compare the found argument names with the expected ones and
10 generate a message if there are arguments missing.
11
12 :param found_argument_names: argument names found in the docstring
13
14 :param message_id: pylint message id
15
16 :param not_needed_names: names that may be omitted
17
18 :param expected_argument_names: Expected argument names
19
20 :param warning_node: The node to be analyzed
21 """
22 potential_missing_argument_names = (
23 expected_argument_names - found_argument_names
24 ) - not_needed_names
25
26 # Handle variadic and keyword args without asterisks
27 missing_argument_names = set()
28 for name in potential_missing_argument_names:
29 if name.replace("*", "") in found_argument_names:
30 continue
31 missing_argument_names.add(name)
32
33 if missing_argument_names:
34 self.add_message(
35 message_id,
36 args=(", ".join(sorted(missing_argument_names)),),
37 node=warning_node,
38 confidence=HIGH,
39 )
Path 3: 4 calls (0.02)
{'kwargs', 'named_arg'} (3) {'args', 'named_arg'} (1)
'missing-param-doc' (4)
{'self', 'cls'} (4)
{'**kwargs', 'named_arg'} (3) {'*args', 'named_arg'} (1)
FunctionDef (4)
1def _compare_missing_args(
2 self,
3 found_argument_names: set[str],
4 message_id: str,
5 not_needed_names: set[str],
6 expected_argument_names: set[str],
7 warning_node: nodes.NodeNG,
8 ) -> None:
9 """Compare the found argument names with the expected ones and
10 generate a message if there are arguments missing.
11
12 :param found_argument_names: argument names found in the docstring
13
14 :param message_id: pylint message id
15
16 :param not_needed_names: names that may be omitted
17
18 :param expected_argument_names: Expected argument names
19
20 :param warning_node: The node to be analyzed
21 """
22 potential_missing_argument_names = (
23 expected_argument_names - found_argument_names
24 ) - not_needed_names
25
26 # Handle variadic and keyword args without asterisks
27 missing_argument_names = set()
28 for name in potential_missing_argument_names:
29 if name.replace("*", "") in found_argument_names:
30 continue
31 missing_argument_names.add(name)
32
33 if missing_argument_names:
34 self.add_message(
35 message_id,
36 args=(", ".join(sorted(missing_argument_names)),),
37 node=warning_node,
38 confidence=HIGH,
39 )