Method: pylint.checkers.design_analysis._count_methods_in_class
Calls: 1323, Exceptions: 0, Paths: 3Back
Path 1: 672 calls (0.51)
ClassDef (672)
1 (290) 0 (190) 2 (108) 3 (33) 4 (14) 5 (8) 6 (5) 8 (3) 7 (2) 12 (2)
1def _count_methods_in_class(node: nodes.ClassDef) -> int:
2 all_methods = sum(1 for method in node.methods() if not method.name.startswith("_"))
3 # Special methods count towards the number of public methods,
4 # but don't count towards there being too many methods.
5 for method in node.mymethods():
6 if SPECIAL_OBJ.search(method.name) and method.name != "__init__":
7 all_methods += 1
8 return all_methods
Path 2: 452 calls (0.34)
ClassDef (452)
0 (380) 11 (22) 2 (15) 1 (11) 5 (7) 3 (5) 47 (5) 10 (3) 17 (1) 6 (1)
1def _count_methods_in_class(node: nodes.ClassDef) -> int:
2 all_methods = sum(1 for method in node.methods() if not method.name.startswith("_"))
3 # Special methods count towards the number of public methods,
4 # but don't count towards there being too many methods.
5 for method in node.mymethods():
6 if SPECIAL_OBJ.search(method.name) and method.name != "__init__":
7 all_methods += 1
8 return all_methods
Path 3: 199 calls (0.15)
ClassDef (199)
1 (132) 2 (34) 3 (11) 12 (8) 13 (4) 4 (3) 5 (2) 9 (2) 11 (1) 10 (1)
1def _count_methods_in_class(node: nodes.ClassDef) -> int:
2 all_methods = sum(1 for method in node.methods() if not method.name.startswith("_"))
3 # Special methods count towards the number of public methods,
4 # but don't count towards there being too many methods.
5 for method in node.mymethods():
6 if SPECIAL_OBJ.search(method.name) and method.name != "__init__":
7 all_methods += 1
8 return all_methods