Method: pylint.checkers.utils.is_func_decorator
Calls: 5043, Exceptions: 0, Paths: 5Back
Path 1: 3390 calls (0.67)
Module (3390)
False (3390)
1def is_func_decorator(node: nodes.NodeNG) -> bool:
2 """Return true if the name is used in function decorator."""
3 for parent in node.node_ancestors():
4 if isinstance(parent, nodes.Decorators):
5 return True
6 if parent.is_statement or isinstance(
7 parent,
8 (
9 nodes.Lambda,
10 nodes.ComprehensionScope,
11 nodes.ListComp,
12 ),
13 ):
14 break
15 return False
Path 2: 945 calls (0.19)
FunctionDef (926) ClassDef (17) AsyncFunctionDef (2)
False (945)
1def is_func_decorator(node: nodes.NodeNG) -> bool:
2 """Return true if the name is used in function decorator."""
3 for parent in node.node_ancestors():
4 if isinstance(parent, nodes.Decorators):
5 return True
6 if parent.is_statement or isinstance(
7 parent,
8 (
9 nodes.Lambda,
10 nodes.ComprehensionScope,
11 nodes.ListComp,
12 ),
13 ):
14 break
15 return False
Path 3: 676 calls (0.13)
FunctionDef (583) ListComp (30) DictComp (25) Lambda (25) AsyncFunctionDef (7) GeneratorExp (4) SetComp (2)
False (676)
1def is_func_decorator(node: nodes.NodeNG) -> bool:
2 """Return true if the name is used in function decorator."""
3 for parent in node.node_ancestors():
4 if isinstance(parent, nodes.Decorators):
5 return True
6 if parent.is_statement or isinstance(
7 parent,
8 (
9 nodes.Lambda,
10 nodes.ComprehensionScope,
11 nodes.ListComp,
12 ),
13 ):
14 break
15 return False
Path 4: 29 calls (0.01)
ListComp (16) GeneratorExp (10) Lambda (2) DictComp (1)
False (29)
1def is_func_decorator(node: nodes.NodeNG) -> bool:
2 """Return true if the name is used in function decorator."""
3 for parent in node.node_ancestors():
4 if isinstance(parent, nodes.Decorators):
5 return True
6 if parent.is_statement or isinstance(
7 parent,
8 (
9 nodes.Lambda,
10 nodes.ComprehensionScope,
11 nodes.ListComp,
12 ),
13 ):
14 break
15 return False
Path 5: 3 calls (0.0)
GeneratorExp (3)
True (3)
1def is_func_decorator(node: nodes.NodeNG) -> bool:
2 """Return true if the name is used in function decorator."""
3 for parent in node.node_ancestors():
4 if isinstance(parent, nodes.Decorators):
5 return True
6 if parent.is_statement or isinstance(
7 parent,
8 (
9 nodes.Lambda,
10 nodes.ComprehensionScope,
11 nodes.ListComp,
12 ),
13 ):
14 break
15 return False