Method: pylint.checkers.strings.StringFormatChecker.visit_call
Calls: 5709, Exceptions: 0, Paths: 7Back
Path 1: 4892 calls (0.86)
Call (4892)
1def visit_call(self, node: nodes.Call) -> None:
2 func = utils.safe_infer(node.func)
3 if (
4 isinstance(func, astroid.BoundMethod)
5 and isinstance(func.bound, astroid.Instance)
6 and func.bound.name in {"str", "unicode", "bytes"}
7 ):
8 if func.name in {"strip", "lstrip", "rstrip"} and node.args:
9 arg = utils.safe_infer(node.args[0])
10 if not isinstance(arg, nodes.Const) or not isinstance(arg.value, str):
11 return
12 if len(arg.value) != len(set(arg.value)):
13 self.add_message(
14 "bad-str-strip-call",
15 node=node,
16 args=(func.bound.name, func.name),
17 )
18 elif func.name == "format":
19 self._check_new_format(node, func)
Path 2: 434 calls (0.08)
Call (434)
1def visit_call(self, node: nodes.Call) -> None:
2 func = utils.safe_infer(node.func)
3 if (
4 isinstance(func, astroid.BoundMethod)
5 and isinstance(func.bound, astroid.Instance)
6 and func.bound.name in {"str", "unicode", "bytes"}
7 ):
8 if func.name in {"strip", "lstrip", "rstrip"} and node.args:
9 arg = utils.safe_infer(node.args[0])
10 if not isinstance(arg, nodes.Const) or not isinstance(arg.value, str):
11 return
12 if len(arg.value) != len(set(arg.value)):
13 self.add_message(
14 "bad-str-strip-call",
15 node=node,
16 args=(func.bound.name, func.name),
17 )
18 elif func.name == "format":
19 self._check_new_format(node, func)
Path 3: 152 calls (0.03)
Call (152)
1def visit_call(self, node: nodes.Call) -> None:
2 func = utils.safe_infer(node.func)
3 if (
4 isinstance(func, astroid.BoundMethod)
5 and isinstance(func.bound, astroid.Instance)
6 and func.bound.name in {"str", "unicode", "bytes"}
7 ):
8 if func.name in {"strip", "lstrip", "rstrip"} and node.args:
9 arg = utils.safe_infer(node.args[0])
10 if not isinstance(arg, nodes.Const) or not isinstance(arg.value, str):
11 return
12 if len(arg.value) != len(set(arg.value)):
13 self.add_message(
14 "bad-str-strip-call",
15 node=node,
16 args=(func.bound.name, func.name),
17 )
18 elif func.name == "format":
19 self._check_new_format(node, func)
Path 4: 140 calls (0.02)
Call (140)
1def visit_call(self, node: nodes.Call) -> None:
2 func = utils.safe_infer(node.func)
3 if (
4 isinstance(func, astroid.BoundMethod)
5 and isinstance(func.bound, astroid.Instance)
6 and func.bound.name in {"str", "unicode", "bytes"}
7 ):
8 if func.name in {"strip", "lstrip", "rstrip"} and node.args:
9 arg = utils.safe_infer(node.args[0])
10 if not isinstance(arg, nodes.Const) or not isinstance(arg.value, str):
11 return
12 if len(arg.value) != len(set(arg.value)):
13 self.add_message(
14 "bad-str-strip-call",
15 node=node,
16 args=(func.bound.name, func.name),
17 )
18 elif func.name == "format":
19 self._check_new_format(node, func)
Path 5: 87 calls (0.02)
Call (87)
1def visit_call(self, node: nodes.Call) -> None:
2 func = utils.safe_infer(node.func)
3 if (
4 isinstance(func, astroid.BoundMethod)
5 and isinstance(func.bound, astroid.Instance)
6 and func.bound.name in {"str", "unicode", "bytes"}
7 ):
8 if func.name in {"strip", "lstrip", "rstrip"} and node.args:
9 arg = utils.safe_infer(node.args[0])
10 if not isinstance(arg, nodes.Const) or not isinstance(arg.value, str):
11 return
12 if len(arg.value) != len(set(arg.value)):
13 self.add_message(
14 "bad-str-strip-call",
15 node=node,
16 args=(func.bound.name, func.name),
17 )
18 elif func.name == "format":
19 self._check_new_format(node, func)
Path 6: 3 calls (0.0)
Call (3)
1def visit_call(self, node: nodes.Call) -> None:
2 func = utils.safe_infer(node.func)
3 if (
4 isinstance(func, astroid.BoundMethod)
5 and isinstance(func.bound, astroid.Instance)
6 and func.bound.name in {"str", "unicode", "bytes"}
7 ):
8 if func.name in {"strip", "lstrip", "rstrip"} and node.args:
9 arg = utils.safe_infer(node.args[0])
10 if not isinstance(arg, nodes.Const) or not isinstance(arg.value, str):
11 return
12 if len(arg.value) != len(set(arg.value)):
13 self.add_message(
14 "bad-str-strip-call",
15 node=node,
16 args=(func.bound.name, func.name),
17 )
18 elif func.name == "format":
19 self._check_new_format(node, func)
Path 7: 1 calls (0.0)
Call (1)
1def visit_call(self, node: nodes.Call) -> None:
2 func = utils.safe_infer(node.func)
3 if (
4 isinstance(func, astroid.BoundMethod)
5 and isinstance(func.bound, astroid.Instance)
6 and func.bound.name in {"str", "unicode", "bytes"}
7 ):
8 if func.name in {"strip", "lstrip", "rstrip"} and node.args:
9 arg = utils.safe_infer(node.args[0])
10 if not isinstance(arg, nodes.Const) or not isinstance(arg.value, str):
11 return
12 if len(arg.value) != len(set(arg.value)):
13 self.add_message(
14 "bad-str-strip-call",
15 node=node,
16 args=(func.bound.name, func.name),
17 )
18 elif func.name == "format":
19 self._check_new_format(node, func)