fname stringlengths 63 176 | rel_fname stringclasses 706
values | line int64 -1 4.5k | name stringlengths 1 81 | kind stringclasses 2
values | category stringclasses 2
values | info stringlengths 0 77.9k ⌀ |
|---|---|---|---|---|---|---|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 494 | _dummy_rgx | def | function | def _dummy_rgx(self):
return self.linter.config.dummy_variables_rgx
@staticmethod
def _is_bool_const(node):
return isinstance(node.value, nodes.Const) and isinstance(
node.value.value, bool
)
def _is_actual_elif(self, node):
"""Check if the given node is an ... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 498 | _is_bool_const | def | function | def _is_bool_const(node):
return isinstance(node.value, nodes.Const) and isinstance(
node.value.value, bool
)
def _is_actual_elif(self, node):
"""Check if the given node is an actual elif.
This is a problem we're having with the builtin ast module,
which spl... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 503 | _is_actual_elif | def | function | def _is_actual_elif(self, node):
"""Check if the given node is an actual elif.
This is a problem we're having with the builtin ast module,
which splits `elif` branches into a separate if statement.
Unfortunately we need to know the exact type in certain
cases.
"""
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 519 | _check_simplifiable_if | def | function | def _check_simplifiable_if(self, node):
"""Check if the given if node can be simplified.
The if statement can be reduced to a boolean expression
in some cases. For instance, if there are two branches
and both of them return a boolean value that depends on
the result of the s... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 529 | _is_actual_elif | ref | function | if self._is_actual_elif(node):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 541 | _is_bool_const | ref | function | first_branch_is_bool = self._is_bool_const(first_branch)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 542 | _is_bool_const | ref | function | else_branch_is_bool = self._is_bool_const(else_branch)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 564 | _is_bool_const | ref | function | first_branch_is_bool = self._is_bool_const(first_branch)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 565 | _is_bool_const | ref | function | else_branch_is_bool = self._is_bool_const(else_branch)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 588 | add_message | ref | function | self.add_message("simplifiable-if-statement", node=node, args=(reduced_to,))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 590 | process_tokens | def | function | def process_tokens(self, tokens: list[tokenize.TokenInfo]) -> None:
# Process tokens and look for 'if' or 'elif'
for index, token in enumerate(tokens):
token_string = token[1]
if token_string == "elif":
# AST exists by the time process_tokens is called, so
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 602 | _is_trailing_comma | ref | function | elif _is_trailing_comma(tokens, index):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 603 | is_message_enabled | ref | function | if self.linter.is_message_enabled("trailing-comma-tuple"):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 604 | add_message | ref | function | self.add_message("trailing-comma-tuple", line=token.start[0])
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 606 | only_required_for_messages | ref | function | @utils.only_required_for_messages("consider-using-with")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 607 | leave_module | def | function | def leave_module(self, _: nodes.Module) -> None:
# check for context managers that have been created but not used
self._emit_consider_using_with_if_needed(
self._consider_using_with_stack.module_scope
)
self._init()
@utils.only_required_for_messages("too-many-nested-... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 609 | _emit_consider_using_with_if_needed | ref | function | self._emit_consider_using_with_if_needed(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 612 | _init | ref | function | self._init()
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 614 | only_required_for_messages | ref | function | @utils.only_required_for_messages("too-many-nested-blocks")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 615 | visit_tryexcept | def | function | def visit_tryexcept(self, node: nodes.TryExcept) -> None:
self._check_nested_blocks(node)
visit_tryfinally = visit_tryexcept
visit_while = visit_tryexcept
def _check_redefined_argument_from_local(self, name_node):
if self._dummy_rgx and self._dummy_rgx.match(name_node.name):
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 616 | _check_nested_blocks | ref | function | self._check_nested_blocks(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 621 | _check_redefined_argument_from_local | def | function | def _check_redefined_argument_from_local(self, name_node):
if self._dummy_rgx and self._dummy_rgx.match(name_node.name):
return
if not name_node.lineno:
# Unknown position, maybe it is a manually built AST?
return
scope = name_node.scope()
if not ... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 622 | match | ref | function | if self._dummy_rgx and self._dummy_rgx.match(name_node.name):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 628 | scope | ref | function | scope = name_node.scope()
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 632 | nodes_of_class | ref | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 636 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 642 | only_required_for_messages | ref | function | @utils.only_required_for_messages(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 648 | visit_for | def | function | def visit_for(self, node: nodes.For) -> None:
self._check_nested_blocks(node)
self._check_unnecessary_dict_index_lookup(node)
self._check_unnecessary_list_index_lookup(node)
for name in node.target.nodes_of_class(nodes.AssignName):
self._check_redefined_argument_from_loc... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 649 | _check_nested_blocks | ref | function | self._check_nested_blocks(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 650 | _check_unnecessary_dict_index_lookup | ref | function | self._check_unnecessary_dict_index_lookup(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 651 | _check_unnecessary_list_index_lookup | ref | function | self._check_unnecessary_list_index_lookup(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 653 | nodes_of_class | ref | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 654 | _check_redefined_argument_from_local | ref | function | self._check_redefined_argument_from_local(name)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 656 | only_required_for_messages | ref | function | @utils.only_required_for_messages("redefined-argument-from-local")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 657 | visit_excepthandler | def | function | def visit_excepthandler(self, node: nodes.ExceptHandler) -> None:
if node.name and isinstance(node.name, nodes.AssignName):
self._check_redefined_argument_from_local(node.name)
@utils.only_required_for_messages(
"redefined-argument-from-local", "consider-using-with"
)
def vi... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 659 | _check_redefined_argument_from_local | ref | function | self._check_redefined_argument_from_local(node.name)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 661 | only_required_for_messages | ref | function | @utils.only_required_for_messages(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 664 | visit_with | def | function | def visit_with(self, node: nodes.With) -> None:
for var, names in node.items:
if isinstance(var, nodes.Name):
for stack in self._consider_using_with_stack:
# We don't need to restrict the stacks we search to the current scope and outer scopes,
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 675 | nodes_of_class | ref | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 676 | _check_redefined_argument_from_local | ref | function | self._check_redefined_argument_from_local(name)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 678 | _check_superfluous_else | def | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 683 | _is_actual_elif | ref | function | if self._is_actual_elif(node):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 687 | _if_statement_is_always_returning | ref | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 693 | add_message | ref | function | self.add_message(msg_id, node=node, args=args)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 695 | _check_superfluous_else_return | def | function | def _check_superfluous_else_return(self, node):
return self._check_superfluous_else(
node, msg_id="no-else-return", returning_node_class=nodes.Return
)
def _check_superfluous_else_raise(self, node):
return self._check_superfluous_else(
node, msg_id="no-else-raise... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 696 | _check_superfluous_else | ref | function | return self._check_superfluous_else(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 700 | _check_superfluous_else_raise | def | function | def _check_superfluous_else_raise(self, node):
return self._check_superfluous_else(
node, msg_id="no-else-raise", returning_node_class=nodes.Raise
)
def _check_superfluous_else_break(self, node):
return self._check_superfluous_else(
node, msg_id="no-else-break", ... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 701 | _check_superfluous_else | ref | function | return self._check_superfluous_else(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 705 | _check_superfluous_else_break | def | function | def _check_superfluous_else_break(self, node):
return self._check_superfluous_else(
node, msg_id="no-else-break", returning_node_class=nodes.Break
)
def _check_superfluous_else_continue(self, node):
return self._check_superfluous_else(
node, msg_id="no-else-conti... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 706 | _check_superfluous_else | ref | function | return self._check_superfluous_else(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 710 | _check_superfluous_else_continue | def | function | def _check_superfluous_else_continue(self, node):
return self._check_superfluous_else(
node, msg_id="no-else-continue", returning_node_class=nodes.Continue
)
@staticmethod
def _type_and_name_are_equal(node_a, node_b):
for _type in (nodes.Name, nodes.AssignName):
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 711 | _check_superfluous_else | ref | function | return self._check_superfluous_else(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 716 | _type_and_name_are_equal | def | function | def _type_and_name_are_equal(node_a, node_b):
for _type in (nodes.Name, nodes.AssignName):
if all(isinstance(_node, _type) for _node in (node_a, node_b)):
return node_a.name == node_b.name
if all(isinstance(_node, nodes.Const) for _node in (node_a, node_b)):
r... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 724 | _is_dict_get_block | def | function | def _is_dict_get_block(self, node):
# "if <compare node>"
if not isinstance(node.test, nodes.Compare):
return _False
# Does not have a single statement in the guard's body
if len(node.body) != 1:
return _False
# Look for a single variable assignment... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 747 | _type_and_name_are_equal | ref | function | self._type_and_name_are_equal(stmt.value.value, node.test.ops[0][1])
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 748 | _type_and_name_are_equal | ref | function | and self._type_and_name_are_equal(slice_value, node.test.left)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 753 | safe_infer | ref | function | return isinstance(utils.safe_infer(node.test.ops[0][1]), nodes.Dict)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 755 | _check_consider_get | def | function | def _check_consider_get(self, node):
if_block_ok = self._is_dict_get_block(node)
if if_block_ok and not node.orelse:
self.add_message("consider-using-get", node=node)
elif (
if_block_ok
and len(node.orelse) == 1
and isinstance(node.orelse[0], n... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 756 | _is_dict_get_block | ref | function | if_block_ok = self._is_dict_get_block(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 758 | add_message | ref | function | self.add_message("consider-using-get", node=node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 763 | _type_and_name_are_equal | ref | function | and self._type_and_name_are_equal(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 768 | add_message | ref | function | self.add_message("consider-using-get", node=node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 770 | only_required_for_messages | ref | function | @utils.only_required_for_messages(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 781 | visit_if | def | function | def visit_if(self, node: nodes.If) -> None:
self._check_simplifiable_if(node)
self._check_nested_blocks(node)
self._check_superfluous_else_return(node)
self._check_superfluous_else_raise(node)
self._check_superfluous_else_break(node)
self._check_superfluous_else_conti... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 782 | _check_simplifiable_if | ref | function | self._check_simplifiable_if(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 783 | _check_nested_blocks | ref | function | self._check_nested_blocks(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 784 | _check_superfluous_else_return | ref | function | self._check_superfluous_else_return(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 785 | _check_superfluous_else_raise | ref | function | self._check_superfluous_else_raise(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 786 | _check_superfluous_else_break | ref | function | self._check_superfluous_else_break(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 787 | _check_superfluous_else_continue | ref | function | self._check_superfluous_else_continue(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 788 | _check_consider_get | ref | function | self._check_consider_get(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 789 | _check_consider_using_min_max_builtin | ref | function | self._check_consider_using_min_max_builtin(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 791 | _check_consider_using_min_max_builtin | def | function | def _check_consider_using_min_max_builtin(self, node: nodes.If):
"""Check if the given if node can be refactored as a min/max python builtin."""
if self._is_actual_elif(node) or node.orelse:
# Not interested in if statements with multiple branches.
return
if len(node... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 793 | _is_actual_elif | ref | function | if self._is_actual_elif(node) or node.orelse:
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 859 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 866 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 870 | only_required_for_messages | ref | function | @utils.only_required_for_messages("simplifiable-if-expression")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 871 | visit_ifexp | def | function | def visit_ifexp(self, node: nodes.IfExp) -> None:
self._check_simplifiable_ifexp(node)
def _check_simplifiable_ifexp(self, node):
if not isinstance(node.body, nodes.Const) or not isinstance(
node.orelse, nodes.Const
):
return
if not isinstance(node.body.... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 872 | _check_simplifiable_ifexp | ref | function | self._check_simplifiable_ifexp(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 874 | _check_simplifiable_ifexp | def | function | def _check_simplifiable_ifexp(self, node):
if not isinstance(node.body, nodes.Const) or not isinstance(
node.orelse, nodes.Const
):
return
if not isinstance(node.body.value, bool) or not isinstance(
node.orelse.value, bool
):
return
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 897 | add_message | ref | function | self.add_message("simplifiable-if-expression", node=node, args=(reduced_to,))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 899 | only_required_for_messages | ref | function | @utils.only_required_for_messages(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 905 | leave_functiondef | def | function | def leave_functiondef(self, node: nodes.FunctionDef) -> None:
# check left-over nested blocks stack
self._emit_nested_blocks_message_if_needed(self._nested_blocks)
# new scope = reinitialize the stack of nested blocks
self._nested_blocks = []
# check consistent return stateme... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 907 | _emit_nested_blocks_message_if_needed | ref | function | self._emit_nested_blocks_message_if_needed(self._nested_blocks)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 911 | _check_consistent_returns | ref | function | self._check_consistent_returns(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 913 | _check_return_at_the_end | ref | function | self._check_return_at_the_end(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 916 | _emit_consider_using_with_if_needed | ref | function | self._emit_consider_using_with_if_needed(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 921 | only_required_for_messages | ref | function | @utils.only_required_for_messages("consider-using-with")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 922 | leave_classdef | def | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 924 | _emit_consider_using_with_if_needed | ref | function | self._emit_consider_using_with_if_needed(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 929 | only_required_for_messages | ref | function | @utils.only_required_for_messages("stop-iteration-return")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 930 | visit_raise | def | function | def visit_raise(self, node: nodes.Raise) -> None:
self._check_stop_iteration_inside_generator(node)
def _check_stop_iteration_inside_generator(self, node):
"""Check if an exception of type StopIteration is raised inside a generator."""
frame = node.frame(future=_True)
if not isi... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 931 | _check_stop_iteration_inside_generator | ref | function | self._check_stop_iteration_inside_generator(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 933 | _check_stop_iteration_inside_generator | def | function | def _check_stop_iteration_inside_generator(self, node):
"""Check if an exception of type StopIteration is raised inside a generator."""
frame = node.frame(future=_True)
if not isinstance(frame, nodes.FunctionDef) or not frame.is_generator():
return
if utils.node_ignores_e... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 935 | frame | ref | function | frame = node.frame(future=True)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 936 | is_generator | ref | function | if not isinstance(frame, nodes.FunctionDef) or not frame.is_generator():
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 938 | node_ignores_exception | ref | function | if utils.node_ignores_exception(node, StopIteration):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 942 | safe_infer | ref | function | exc = utils.safe_infer(node.exc)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 945 | _check_exception_inherit_from_stopiteration | ref | function | if self._check_exception_inherit_from_stopiteration(exc):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/refactoring/refactoring_checker.py | pylint/checkers/refactoring/refactoring_checker.py | 946 | add_message | ref | function | self.add_message("stop-iteration-return", node=node)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.