Method: pylint.checkers.ellipsis_checker.EllipsisChecker.visit_const
Calls: 11998, Exceptions: 0, Paths: 7Back
Path 1: 11778 calls (0.98)
Const (11778)
1@only_required_for_messages("unnecessary-ellipsis")
2 def visit_const(self, node: nodes.Const) -> None:
3 """Check if the ellipsis constant is used unnecessarily.
4
5 Emits a warning when:
6 - A line consisting of an ellipsis is preceded by a docstring.
7 - A statement exists in the same scope as the ellipsis.
8 For example: A function consisting of an ellipsis followed by a
9 return statement on the next line.
10 """
11 if (
12 node.pytype() == "builtins.Ellipsis"
13 and isinstance(node.parent, nodes.Expr)
14 and (
15 (
16 isinstance(node.parent.parent, (nodes.ClassDef, nodes.FunctionDef))
17 and node.parent.parent.doc_node
18 )
19 or len(node.parent.parent.body) > 1
20 )
21 ):
22 self.add_message("unnecessary-ellipsis", node=node)
Path 2: 97 calls (0.01)
Const (97)
1@only_required_for_messages("unnecessary-ellipsis")
2 def visit_const(self, node: nodes.Const) -> None:
3 """Check if the ellipsis constant is used unnecessarily.
4
5 Emits a warning when:
6 - A line consisting of an ellipsis is preceded by a docstring.
7 - A statement exists in the same scope as the ellipsis.
8 For example: A function consisting of an ellipsis followed by a
9 return statement on the next line.
10 """
11 if (
12 node.pytype() == "builtins.Ellipsis"
13 and isinstance(node.parent, nodes.Expr)
14 and (
15 (
16 isinstance(node.parent.parent, (nodes.ClassDef, nodes.FunctionDef))
17 and node.parent.parent.doc_node
18 )
19 or len(node.parent.parent.body) > 1
20 )
21 ):
22 self.add_message("unnecessary-ellipsis", node=node)
Path 3: 66 calls (0.01)
Const (66)
1@only_required_for_messages("unnecessary-ellipsis")
2 def visit_const(self, node: nodes.Const) -> None:
3 """Check if the ellipsis constant is used unnecessarily.
4
5 Emits a warning when:
6 - A line consisting of an ellipsis is preceded by a docstring.
7 - A statement exists in the same scope as the ellipsis.
8 For example: A function consisting of an ellipsis followed by a
9 return statement on the next line.
10 """
11 if (
12 node.pytype() == "builtins.Ellipsis"
13 and isinstance(node.parent, nodes.Expr)
14 and (
15 (
16 isinstance(node.parent.parent, (nodes.ClassDef, nodes.FunctionDef))
17 and node.parent.parent.doc_node
18 )
19 or len(node.parent.parent.body) > 1
20 )
21 ):
22 self.add_message("unnecessary-ellipsis", node=node)
Path 4: 51 calls (0.0)
Const (51)
1@only_required_for_messages("unnecessary-ellipsis")
2 def visit_const(self, node: nodes.Const) -> None:
3 """Check if the ellipsis constant is used unnecessarily.
4
5 Emits a warning when:
6 - A line consisting of an ellipsis is preceded by a docstring.
7 - A statement exists in the same scope as the ellipsis.
8 For example: A function consisting of an ellipsis followed by a
9 return statement on the next line.
10 """
11 if (
12 node.pytype() == "builtins.Ellipsis"
13 and isinstance(node.parent, nodes.Expr)
14 and (
15 (
16 isinstance(node.parent.parent, (nodes.ClassDef, nodes.FunctionDef))
17 and node.parent.parent.doc_node
18 )
19 or len(node.parent.parent.body) > 1
20 )
21 ):
22 self.add_message("unnecessary-ellipsis", node=node)
Path 5: 4 calls (0.0)
Const (4)
1@only_required_for_messages("unnecessary-ellipsis")
2 def visit_const(self, node: nodes.Const) -> None:
3 """Check if the ellipsis constant is used unnecessarily.
4
5 Emits a warning when:
6 - A line consisting of an ellipsis is preceded by a docstring.
7 - A statement exists in the same scope as the ellipsis.
8 For example: A function consisting of an ellipsis followed by a
9 return statement on the next line.
10 """
11 if (
12 node.pytype() == "builtins.Ellipsis"
13 and isinstance(node.parent, nodes.Expr)
14 and (
15 (
16 isinstance(node.parent.parent, (nodes.ClassDef, nodes.FunctionDef))
17 and node.parent.parent.doc_node
18 )
19 or len(node.parent.parent.body) > 1
20 )
21 ):
22 self.add_message("unnecessary-ellipsis", node=node)
Path 6: 1 calls (0.0)
Const (1)
1@only_required_for_messages("unnecessary-ellipsis")
2 def visit_const(self, node: nodes.Const) -> None:
3 """Check if the ellipsis constant is used unnecessarily.
4
5 Emits a warning when:
6 - A line consisting of an ellipsis is preceded by a docstring.
7 - A statement exists in the same scope as the ellipsis.
8 For example: A function consisting of an ellipsis followed by a
9 return statement on the next line.
10 """
11 if (
12 node.pytype() == "builtins.Ellipsis"
13 and isinstance(node.parent, nodes.Expr)
14 and (
15 (
16 isinstance(node.parent.parent, (nodes.ClassDef, nodes.FunctionDef))
17 and node.parent.parent.doc_node
18 )
19 or len(node.parent.parent.body) > 1
20 )
21 ):
22 self.add_message("unnecessary-ellipsis", node=node)
Path 7: 1 calls (0.0)
Const (1)
1@only_required_for_messages("unnecessary-ellipsis")
2 def visit_const(self, node: nodes.Const) -> None:
3 """Check if the ellipsis constant is used unnecessarily.
4
5 Emits a warning when:
6 - A line consisting of an ellipsis is preceded by a docstring.
7 - A statement exists in the same scope as the ellipsis.
8 For example: A function consisting of an ellipsis followed by a
9 return statement on the next line.
10 """
11 if (
12 node.pytype() == "builtins.Ellipsis"
13 and isinstance(node.parent, nodes.Expr)
14 and (
15 (
16 isinstance(node.parent.parent, (nodes.ClassDef, nodes.FunctionDef))
17 and node.parent.parent.doc_node
18 )
19 or len(node.parent.parent.body) > 1
20 )
21 ):
22 self.add_message("unnecessary-ellipsis", node=node)