Method: pylint.extensions.dunder.DunderChecker.visit_functiondef
Calls: 13, Exceptions: 0, Paths: 5Back
Path 1: 5 calls (0.38)
FunctionDef (5)
1def visit_functiondef(self, node: nodes.FunctionDef) -> None:
2 """Check if known dunder method is misspelled or dunder name is not one
3 of the pre-defined names.
4 """
5 # ignore module-level functions
6 if not node.is_method():
7 return
8
9 # Detect something that could be a bad dunder method
10 if (
11 node.name.startswith("_")
12 and node.name.endswith("_")
13 and node.name not in self._dunder_methods
14 ):
15 self.add_message(
16 "bad-dunder-name",
17 node=node,
18 args=(node.name),
19 confidence=HIGH,
20 )
Path 2: 3 calls (0.23)
FunctionDef (3)
1def visit_functiondef(self, node: nodes.FunctionDef) -> None:
2 """Check if known dunder method is misspelled or dunder name is not one
3 of the pre-defined names.
4 """
5 # ignore module-level functions
6 if not node.is_method():
7 return
8
9 # Detect something that could be a bad dunder method
10 if (
11 node.name.startswith("_")
12 and node.name.endswith("_")
13 and node.name not in self._dunder_methods
14 ):
15 self.add_message(
16 "bad-dunder-name",
17 node=node,
18 args=(node.name),
19 confidence=HIGH,
20 )
Path 3: 2 calls (0.15)
FunctionDef (2)
1def visit_functiondef(self, node: nodes.FunctionDef) -> None:
2 """Check if known dunder method is misspelled or dunder name is not one
3 of the pre-defined names.
4 """
5 # ignore module-level functions
6 if not node.is_method():
7 return
8
9 # Detect something that could be a bad dunder method
10 if (
11 node.name.startswith("_")
12 and node.name.endswith("_")
13 and node.name not in self._dunder_methods
14 ):
15 self.add_message(
16 "bad-dunder-name",
17 node=node,
18 args=(node.name),
19 confidence=HIGH,
20 )
Path 4: 2 calls (0.15)
FunctionDef (2)
1def visit_functiondef(self, node: nodes.FunctionDef) -> None:
2 """Check if known dunder method is misspelled or dunder name is not one
3 of the pre-defined names.
4 """
5 # ignore module-level functions
6 if not node.is_method():
7 return
8
9 # Detect something that could be a bad dunder method
10 if (
11 node.name.startswith("_")
12 and node.name.endswith("_")
13 and node.name not in self._dunder_methods
14 ):
15 self.add_message(
16 "bad-dunder-name",
17 node=node,
18 args=(node.name),
19 confidence=HIGH,
20 )
Path 5: 1 calls (0.08)
FunctionDef (1)
None (1)
1def visit_functiondef(self, node: nodes.FunctionDef) -> None:
2 """Check if known dunder method is misspelled or dunder name is not one
3 of the pre-defined names.
4 """
5 # ignore module-level functions
6 if not node.is_method():
7 return
8
9 # Detect something that could be a bad dunder method
10 if (
11 node.name.startswith("_")
12 and node.name.endswith("_")
13 and node.name not in self._dunder_methods
14 ):
15 self.add_message(
16 "bad-dunder-name",
17 node=node,
18 args=(node.name),
19 confidence=HIGH,
20 )