Method: pylint.utils.linterstats.LinterStats.increase_bad_name
Calls: 1184, Exceptions: 0, Paths: 2Back
Path 1: 1085 calls (0.92)
'variable' (314) 'const' (277) 'argument' (276) 'function' (65) 'attr' (47) 'method' (36) 'module' (27) 'class_const' (23) 'typevar' (18) 'class_attri...
1 (1085)
1def increase_bad_name(self, node_name: str, increase: int) -> None:
2 """Increase a bad names node count."""
3 if node_name not in {
4 "argument",
5 "attr",
6 "class",
7 "class_attribute",
8 "class_const",
9 "const",
10 "inlinevar",
11 "function",
12 "method",
13 "module",
14 "variable",
15 "typevar",
16 }:
17 raise ValueError("Node type not part of the bad_names stat")
18
19 node_name = cast(
20 Literal[
21 "argument",
22 "attr",
23 "class",
24 "class_attribute",
25 "class_const",
26 "const",
27 "inlinevar",
28 "function",
29 "method",
30 "module",
31 "variable",
32 "typevar",
33 ],
34 node_name,
35 )
36 if node_name == "class":
37 self.bad_names["klass"] += increase
38 else:
39 self.bad_names[node_name] += increase
Path 2: 99 calls (0.08)
'class' (99)
1 (99)
1def increase_bad_name(self, node_name: str, increase: int) -> None:
2 """Increase a bad names node count."""
3 if node_name not in {
4 "argument",
5 "attr",
6 "class",
7 "class_attribute",
8 "class_const",
9 "const",
10 "inlinevar",
11 "function",
12 "method",
13 "module",
14 "variable",
15 "typevar",
16 }:
17 raise ValueError("Node type not part of the bad_names stat")
18
19 node_name = cast(
20 Literal[
21 "argument",
22 "attr",
23 "class",
24 "class_attribute",
25 "class_const",
26 "const",
27 "inlinevar",
28 "function",
29 "method",
30 "module",
31 "variable",
32 "typevar",
33 ],
34 node_name,
35 )
36 if node_name == "class":
37 self.bad_names["klass"] += increase
38 else:
39 self.bad_names[node_name] += increase