Method: pylint.checkers.logging.LoggingChecker._check_call_func
Calls: 12, Exceptions: 0, Paths: 4Back
Path 1: 7 calls (0.58)
Call (7)
1def _check_call_func(self, node: nodes.Call) -> None:
2 """Checks that function call is not format_string.format()."""
3 func = utils.safe_infer(node.func)
4 types = ("str", "unicode")
5 methods = ("format",)
6 if (
7 isinstance(func, astroid.BoundMethod)
8 and is_method_call(func, types, methods)
9 and not is_complex_format_str(func.bound)
10 ):
11 self.add_message(
12 "logging-format-interpolation",
13 node=node,
14 args=(self._helper_string(node),),
15 )
Path 2: 3 calls (0.25)
Call (3)
1def _check_call_func(self, node: nodes.Call) -> None:
2 """Checks that function call is not format_string.format()."""
3 func = utils.safe_infer(node.func)
4 types = ("str", "unicode")
5 methods = ("format",)
6 if (
7 isinstance(func, astroid.BoundMethod)
8 and is_method_call(func, types, methods)
9 and not is_complex_format_str(func.bound)
10 ):
11 self.add_message(
12 "logging-format-interpolation",
13 node=node,
14 args=(self._helper_string(node),),
15 )
Path 3: 1 calls (0.08)
Call (1)
1def _check_call_func(self, node: nodes.Call) -> None:
2 """Checks that function call is not format_string.format()."""
3 func = utils.safe_infer(node.func)
4 types = ("str", "unicode")
5 methods = ("format",)
6 if (
7 isinstance(func, astroid.BoundMethod)
8 and is_method_call(func, types, methods)
9 and not is_complex_format_str(func.bound)
10 ):
11 self.add_message(
12 "logging-format-interpolation",
13 node=node,
14 args=(self._helper_string(node),),
15 )
Path 4: 1 calls (0.08)
Call (1)
1def _check_call_func(self, node: nodes.Call) -> None:
2 """Checks that function call is not format_string.format()."""
3 func = utils.safe_infer(node.func)
4 types = ("str", "unicode")
5 methods = ("format",)
6 if (
7 isinstance(func, astroid.BoundMethod)
8 and is_method_call(func, types, methods)
9 and not is_complex_format_str(func.bound)
10 ):
11 self.add_message(
12 "logging-format-interpolation",
13 node=node,
14 args=(self._helper_string(node),),
15 )