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/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 91 | is_test_condition | ref | function | if not utils.is_test_condition(node, parent):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 102 | add_message | ref | function | self.add_message("use-implicit-booleaness-not-len", node=node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 105 | infer | ref | function | instance = next(len_arg.infer())
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 109 | base_names_of_instance | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 114 | instance_has_bool | ref | function | affected_by_pep8 and not self.instance_has_bool(instance)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 116 | add_message | ref | function | self.add_message("use-implicit-booleaness-not-len", node=node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 119 | instance_has_bool | def | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 127 | check_messages | ref | function | @utils.check_messages("use-implicit-booleaness-not-len")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 128 | visit_unaryop | def | function | def visit_unaryop(self, node: nodes.UnaryOp) -> None:
"""`not len(S)` must become `not S` regardless if the parent block
is a test condition or something else (boolean expression)
e.g. `if not len(S):`
"""
if (
isinstance(node, nodes.UnaryOp)
and node.... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 136 | is_call_of_name | ref | function | and utils.is_call_of_name(node.operand, "len")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 138 | add_message | ref | function | self.add_message("use-implicit-booleaness-not-len", node=node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 140 | check_messages | ref | function | @utils.check_messages("use-implicit-booleaness-not-comparison")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 141 | visit_compare | def | function | def visit_compare(self, node: nodes.Compare) -> None:
self._check_use_implicit_booleaness_not_comparison(node)
def _check_use_implicit_booleaness_not_comparison(
self, node: nodes.Compare
) -> None:
"""Check for left side and right side of the node for empty literals."""
is_... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 142 | _check_use_implicit_booleaness_not_comparison | ref | function | self._check_use_implicit_booleaness_not_comparison(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 144 | _check_use_implicit_booleaness_not_comparison | def | function | def _check_use_implicit_booleaness_not_comparison(
self, node: nodes.Compare
) -> None:
"""Check for left side and right side of the node for empty literals."""
is_left_empty_literal = utils.is_base_container(
node.left
) or utils.is_empty_dict_literal(node.left)
... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 148 | is_base_container | ref | function | is_left_empty_literal = utils.is_base_container(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 150 | is_empty_dict_literal | ref | function | ) or utils.is_empty_dict_literal(node.left)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 154 | is_base_container | ref | function | is_right_empty_literal = utils.is_base_container(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 156 | is_empty_dict_literal | ref | function | ) or utils.is_empty_dict_literal(comparator)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 164 | safe_infer | ref | function | target_instance = utils.safe_infer(target_node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 167 | base_names_of_instance | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 174 | instance_has_bool | ref | function | if not is_base_comprehension_type and self.instance_has_bool(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 189 | as_string | ref | function | instance_name = f"{target_node.func.as_string()}(...)"
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 191 | as_string | ref | function | instance_name = target_node.as_string()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 201 | add_message | ref | function | self.add_message(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 211 | base_names_of_instance | def | function | def base_names_of_instance(
node: Union[bases.Uninferable, bases.Instance]
) -> List[str]:
"""Return all names inherited by a class instance or those returned by a function.
The inherited names include 'object'.
"""
if isinstance(node, bases.Instance):
return... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/implicit_booleaness_checker.py | pylint/checkers/refactoring/implicit_booleaness_checker.py | 219 | ancestors | ref | function | return [node.name] + [x.name for x in node.ancestors()]
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 11 | NotChecker | def | class | visit_unaryop |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 43 | check_messages | ref | function | @utils.check_messages("unneeded-not")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 44 | visit_unaryop | def | function | def visit_unaryop(self, node: nodes.UnaryOp) -> None:
if node.op != "not":
return
operand = node.operand
if isinstance(operand, nodes.UnaryOp) and operand.op == "not":
self.add_message(
"unneeded-not",
node=node,
args=(... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 50 | add_message | ref | function | self.add_message(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 53 | as_string | ref | function | args=(node.as_string(), operand.operand.as_string()),
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 53 | as_string | ref | function | args=(node.as_string(), operand.operand.as_string()),
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 64 | frame | ref | function | frame = node.frame(future=True)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 67 | node_type | ref | function | for _type in (utils.node_type(left), utils.node_type(right)):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 67 | node_type | ref | function | for _type in (utils.node_type(left), utils.node_type(right)):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 74 | qname | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 78 | as_string | ref | function | f"{left.as_string()} {self.reverse_op[operator]} {right.as_string()}"
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 78 | as_string | ref | function | f"{left.as_string()} {self.reverse_op[operator]} {right.as_string()}"
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 80 | add_message | ref | function | self.add_message(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/not_checker.py | pylint/checkers/refactoring/not_checker.py | 81 | as_string | ref | function | "unneeded-not", node=node, args=(node.as_string(), suggestion)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 12 | RecommendationChecker | def | class | open _is_builtin visit_call _check_consider_iterating_dictionary _check_use_maxsplit_arg visit_for _check_consider_using_enumerate _check_consider_using_dict_items visit_comprehension _check_consider_using_dict_items_comprehension _check_use_sequence_for_iteration visit_const _detect_replacable_format_call |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 65 | get_global_option | ref | function | py_version = get_global_option(self, "py-version")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 69 | _is_builtin | def | function | def _is_builtin(node, function):
inferred = utils.safe_infer(node)
if not inferred:
return _False
return utils.is_builtin_object(inferred) and inferred.name == function
@utils.check_messages("consider-iterating-dictionary", "use-maxsplit-arg")
def visit_call(self, node: ... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 70 | safe_infer | ref | function | inferred = utils.safe_infer(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 73 | is_builtin_object | ref | function | return utils.is_builtin_object(inferred) and inferred.name == function
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 75 | check_messages | ref | function | @utils.check_messages("consider-iterating-dictionary", "use-maxsplit-arg")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 76 | visit_call | def | function | def visit_call(self, node: nodes.Call) -> None:
self._check_consider_iterating_dictionary(node)
self._check_use_maxsplit_arg(node)
def _check_consider_iterating_dictionary(self, node: nodes.Call) -> None:
if not isinstance(node.func, nodes.Attribute):
return
if node.... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 77 | _check_consider_iterating_dictionary | ref | function | self._check_consider_iterating_dictionary(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 78 | _check_use_maxsplit_arg | ref | function | self._check_use_maxsplit_arg(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 80 | _check_consider_iterating_dictionary | def | function | def _check_consider_iterating_dictionary(self, node: nodes.Call) -> None:
if not isinstance(node.func, nodes.Attribute):
return
if node.func.attrname != "keys":
return
comp_ancestor = utils.get_node_first_ancestor_of_type(node, nodes.Compare)
if (
... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 85 | get_node_first_ancestor_of_type | ref | function | comp_ancestor = utils.get_node_first_ancestor_of_type(node, nodes.Compare)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 93 | node_ancestors | ref | function | and (comparator in node.node_ancestors() or comparator is node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 96 | safe_infer | ref | function | inferred = utils.safe_infer(node.func)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 101 | add_message | ref | function | self.add_message("consider-iterating-dictionary", node=node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 103 | _check_use_maxsplit_arg | def | function | def _check_use_maxsplit_arg(self, node: nodes.Call) -> None:
"""Add message when accessing first or last elements of a str.split() or str.rsplit()."""
# Check if call is split() or rsplit()
if not (
isinstance(node.func, nodes.Attribute)
and node.func.attrname in {"s... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 110 | safe_infer | ref | function | and isinstance(utils.safe_infer(node.func), astroid.BoundMethod)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 115 | get_argument_from_call | ref | function | sep = utils.get_argument_from_call(node, 0, "sep")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 121 | get_argument_from_call | ref | function | utils.get_argument_from_call(node, 1, "maxsplit")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 128 | get_subscript_const_value | ref | function | subscript_value = utils.get_subscript_const_value(node.parent).value
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 135 | scope | ref | function | scope = node.scope()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 136 | nodes_of_class | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 137 | parent_of | ref | function | if not loop_node.parent_of(node):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 141 | nodes_of_class | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 144 | nodes_of_class | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 154 | as_string | ref | function | node.func.as_string().rsplit(fn_name, maxsplit=1)[0]
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 156 | as_string | ref | function | + f"({sep.as_string()}, maxsplit=1)[{subscript_value}]"
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 158 | add_message | ref | function | self.add_message("use-maxsplit-arg", node=node, args=(new_name,))
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 160 | check_messages | ref | function | @utils.check_messages(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 165 | visit_for | def | function | def visit_for(self, node: nodes.For) -> None:
self._check_consider_using_enumerate(node)
self._check_consider_using_dict_items(node)
self._check_use_sequence_for_iteration(node)
def _check_consider_using_enumerate(self, node: nodes.For) -> None:
"""Emit a convention whenever ran... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 166 | _check_consider_using_enumerate | ref | function | self._check_consider_using_enumerate(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 167 | _check_consider_using_dict_items | ref | function | self._check_consider_using_dict_items(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 168 | _check_use_sequence_for_iteration | ref | function | self._check_use_sequence_for_iteration(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 170 | _check_consider_using_enumerate | def | function | def _check_consider_using_enumerate(self, node: nodes.For) -> None:
"""Emit a convention whenever range and len are used for indexing."""
# Verify that we have a `range([start], len(...), [stop])` call and
# that the object which is iterated is used as a subscript in the
# body of th... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 179 | _is_builtin | ref | function | if not self._is_builtin(node.iter.func, "range"):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 195 | _is_builtin | ref | function | if not self._is_builtin(second_func, "len"):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 208 | scope | ref | function | scope = node.scope()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 221 | nodes_of_class | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 228 | scope | ref | function | if subscript.value.scope() != node.scope():
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 228 | scope | ref | function | if subscript.value.scope() != node.scope():
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 240 | add_message | ref | function | self.add_message("consider-using-enumerate", node=node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 243 | _check_consider_using_dict_items | def | function | def _check_consider_using_dict_items(self, node: nodes.For) -> None:
"""Add message when accessing dict values by index lookup."""
# Verify that we have a .keys() call and
# that the object which is iterated is used as a subscript in the
# body of the for.
iterating_object_n... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 249 | get_iterating_dictionary_name | ref | function | iterating_object_name = utils.get_iterating_dictionary_name(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 258 | nodes_of_class | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 266 | as_string | ref | function | or iterating_object_name != subscript.value.as_string()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 269 | lookup | ref | function | last_definition_lineno = value.lookup(value.name)[1][-1].lineno
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 286 | add_message | ref | function | self.add_message("consider-using-dict-items", node=node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 289 | check_messages | ref | function | @utils.check_messages(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 293 | visit_comprehension | def | function | def visit_comprehension(self, node: nodes.Comprehension) -> None:
self._check_consider_using_dict_items_comprehension(node)
self._check_use_sequence_for_iteration(node)
def _check_consider_using_dict_items_comprehension(
self, node: nodes.Comprehension
) -> None:
"""Add mess... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 294 | _check_consider_using_dict_items_comprehension | ref | function | self._check_consider_using_dict_items_comprehension(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 295 | _check_use_sequence_for_iteration | ref | function | self._check_use_sequence_for_iteration(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 297 | _check_consider_using_dict_items_comprehension | def | function | def _check_consider_using_dict_items_comprehension(
self, node: nodes.Comprehension
) -> None:
"""Add message when accessing dict values by index lookup."""
iterating_object_name = utils.get_iterating_dictionary_name(node)
if iterating_object_name is None:
return
... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 301 | get_iterating_dictionary_name | ref | function | iterating_object_name = utils.get_iterating_dictionary_name(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 305 | get_children | ref | function | for child in node.parent.get_children():
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 306 | nodes_of_class | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 314 | as_string | ref | function | or iterating_object_name != subscript.value.as_string()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 318 | add_message | ref | function | self.add_message("consider-using-dict-items", node=node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 321 | _check_use_sequence_for_iteration | def | function | def _check_use_sequence_for_iteration(
self, node: Union[nodes.For, nodes.Comprehension]
) -> None:
"""Check if code iterates over an in-place defined set."""
if isinstance(node.iter, nodes.Set):
self.add_message("use-sequence-for-iteration", node=node.iter)
@utils.check... |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 326 | add_message | ref | function | self.add_message("use-sequence-for-iteration", node=node.iter)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/checkers/refactoring/recommendation_checker.py | pylint/checkers/refactoring/recommendation_checker.py | 328 | check_messages | ref | function | @utils.check_messages("consider-using-f-string")
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.