Method: pylint.checkers.base.comparison_checker.ComparisonChecker._check_constants_comparison
Calls: 1141, Exceptions: 0, Paths: 3Back
Path 1: 917 calls (0.8)
Compare (917)
None (917)
1def _check_constants_comparison(self, node: nodes.Compare) -> None:
2 """When two constants are being compared it is always a logical tautology."""
3 left_operand = node.left
4 if not isinstance(left_operand, nodes.Const):
5 return
6
7 right_operand = node.ops[0][1]
8 if not isinstance(right_operand, nodes.Const):
9 return
10
11 operator = node.ops[0][0]
12 self.add_message(
13 "comparison-of-constants",
14 node=node,
15 args=(left_operand.value, operator, right_operand.value),
16 confidence=HIGH,
17 )
Path 2: 164 calls (0.14)
Compare (164)
None (164)
1def _check_constants_comparison(self, node: nodes.Compare) -> None:
2 """When two constants are being compared it is always a logical tautology."""
3 left_operand = node.left
4 if not isinstance(left_operand, nodes.Const):
5 return
6
7 right_operand = node.ops[0][1]
8 if not isinstance(right_operand, nodes.Const):
9 return
10
11 operator = node.ops[0][0]
12 self.add_message(
13 "comparison-of-constants",
14 node=node,
15 args=(left_operand.value, operator, right_operand.value),
16 confidence=HIGH,
17 )
Path 3: 60 calls (0.05)
Compare (60)
1def _check_constants_comparison(self, node: nodes.Compare) -> None:
2 """When two constants are being compared it is always a logical tautology."""
3 left_operand = node.left
4 if not isinstance(left_operand, nodes.Const):
5 return
6
7 right_operand = node.ops[0][1]
8 if not isinstance(right_operand, nodes.Const):
9 return
10
11 operator = node.ops[0][0]
12 self.add_message(
13 "comparison-of-constants",
14 node=node,
15 args=(left_operand.value, operator, right_operand.value),
16 confidence=HIGH,
17 )