Method: pylint.checkers.refactoring.refactoring_checker.RefactoringChecker.visit_with
Calls: 168, Exceptions: 0, Paths: 7Back
Path 1: 76 calls (0.45)
With (76)
1@utils.only_required_for_messages(
2 "redefined-argument-from-local", "consider-using-with"
3 )
4 def visit_with(self, node: nodes.With) -> None:
5 for var, names in node.items:
6 if isinstance(var, nodes.Name):
7 for stack in self._consider_using_with_stack:
8 # We don't need to restrict the stacks we search to the current scope and outer scopes,
9 # as e.g. the function_scope stack will be empty when we check a ``with`` on the class level.
10 if var.name in stack:
11 del stack[var.name]
12 break
13 if not names:
14 continue
15 for name in names.nodes_of_class(nodes.AssignName):
16 self._check_redefined_argument_from_local(name)
Path 2: 52 calls (0.31)
With (52)
1@utils.only_required_for_messages(
2 "redefined-argument-from-local", "consider-using-with"
3 )
4 def visit_with(self, node: nodes.With) -> None:
5 for var, names in node.items:
6 if isinstance(var, nodes.Name):
7 for stack in self._consider_using_with_stack:
8 # We don't need to restrict the stacks we search to the current scope and outer scopes,
9 # as e.g. the function_scope stack will be empty when we check a ``with`` on the class level.
10 if var.name in stack:
11 del stack[var.name]
12 break
13 if not names:
14 continue
15 for name in names.nodes_of_class(nodes.AssignName):
16 self._check_redefined_argument_from_local(name)
Path 3: 21 calls (0.12)
With (21)
1@utils.only_required_for_messages(
2 "redefined-argument-from-local", "consider-using-with"
3 )
4 def visit_with(self, node: nodes.With) -> None:
5 for var, names in node.items:
6 if isinstance(var, nodes.Name):
7 for stack in self._consider_using_with_stack:
8 # We don't need to restrict the stacks we search to the current scope and outer scopes,
9 # as e.g. the function_scope stack will be empty when we check a ``with`` on the class level.
10 if var.name in stack:
11 del stack[var.name]
12 break
13 if not names:
14 continue
15 for name in names.nodes_of_class(nodes.AssignName):
16 self._check_redefined_argument_from_local(name)
Path 4: 12 calls (0.07)
With (12)
1@utils.only_required_for_messages(
2 "redefined-argument-from-local", "consider-using-with"
3 )
4 def visit_with(self, node: nodes.With) -> None:
5 for var, names in node.items:
6 if isinstance(var, nodes.Name):
7 for stack in self._consider_using_with_stack:
8 # We don't need to restrict the stacks we search to the current scope and outer scopes,
9 # as e.g. the function_scope stack will be empty when we check a ``with`` on the class level.
10 if var.name in stack:
11 del stack[var.name]
12 break
13 if not names:
14 continue
15 for name in names.nodes_of_class(nodes.AssignName):
16 self._check_redefined_argument_from_local(name)
Path 5: 4 calls (0.02)
With (4)
1@utils.only_required_for_messages(
2 "redefined-argument-from-local", "consider-using-with"
3 )
4 def visit_with(self, node: nodes.With) -> None:
5 for var, names in node.items:
6 if isinstance(var, nodes.Name):
7 for stack in self._consider_using_with_stack:
8 # We don't need to restrict the stacks we search to the current scope and outer scopes,
9 # as e.g. the function_scope stack will be empty when we check a ``with`` on the class level.
10 if var.name in stack:
11 del stack[var.name]
12 break
13 if not names:
14 continue
15 for name in names.nodes_of_class(nodes.AssignName):
16 self._check_redefined_argument_from_local(name)
Path 6: 2 calls (0.01)
With (2)
1@utils.only_required_for_messages(
2 "redefined-argument-from-local", "consider-using-with"
3 )
4 def visit_with(self, node: nodes.With) -> None:
5 for var, names in node.items:
6 if isinstance(var, nodes.Name):
7 for stack in self._consider_using_with_stack:
8 # We don't need to restrict the stacks we search to the current scope and outer scopes,
9 # as e.g. the function_scope stack will be empty when we check a ``with`` on the class level.
10 if var.name in stack:
11 del stack[var.name]
12 break
13 if not names:
14 continue
15 for name in names.nodes_of_class(nodes.AssignName):
16 self._check_redefined_argument_from_local(name)
Path 7: 1 calls (0.01)
With (1)
1@utils.only_required_for_messages(
2 "redefined-argument-from-local", "consider-using-with"
3 )
4 def visit_with(self, node: nodes.With) -> None:
5 for var, names in node.items:
6 if isinstance(var, nodes.Name):
7 for stack in self._consider_using_with_stack:
8 # We don't need to restrict the stacks we search to the current scope and outer scopes,
9 # as e.g. the function_scope stack will be empty when we check a ``with`` on the class level.
10 if var.name in stack:
11 del stack[var.name]
12 break
13 if not names:
14 continue
15 for name in names.nodes_of_class(nodes.AssignName):
16 self._check_redefined_argument_from_local(name)