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/deprecated.py | pylint/checkers/deprecated.py | 73 | only_required_for_messages | ref | function | @utils.only_required_for_messages(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 77 | visit_import | def | function | def visit_import(self, node: nodes.Import) -> None:
"""Triggered when an import statement is seen."""
for name in (name for name, _ in node.names):
self.check_deprecated_module(node, name)
if "." in name:
# Checking deprecation for import module with class
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 80 | check_deprecated_module | ref | function | self.check_deprecated_module(node, name)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 84 | check_deprecated_class | ref | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 86 | deprecated_decorators | def | function | def deprecated_decorators(self) -> Iterable:
"""Callback returning the deprecated decorators.
Returns:
collections.abc.Container of deprecated decorator names.
"""
# pylint: disable=no-self-use
return ()
@utils.only_required_for_messages("deprecated-decorato... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 95 | only_required_for_messages | ref | function | @utils.only_required_for_messages("deprecated-decorator")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 96 | visit_decorators | def | function | def visit_decorators(self, node: nodes.Decorators) -> None:
"""Triggered when a decorator statement is seen."""
children = list(node.get_children())
if not children:
return
if isinstance(children[0], nodes.Call):
inf = safe_infer(children[0].func)
else... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 98 | get_children | ref | function | children = list(node.get_children())
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 102 | safe_infer | ref | function | inf = safe_infer(children[0].func)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 104 | safe_infer | ref | function | inf = safe_infer(children[0])
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 105 | qname | ref | function | qname = inf.qname() if inf else None
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 106 | deprecated_decorators | ref | function | if qname in self.deprecated_decorators():
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 107 | add_message | ref | function | self.add_message("deprecated-decorator", node=node, args=qname)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 109 | only_required_for_messages | ref | function | @utils.only_required_for_messages(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 113 | visit_importfrom | def | function | def visit_importfrom(self, node: nodes.ImportFrom) -> None:
"""Triggered when a from statement is seen."""
basename = node.modname
basename = get_import_name(node, basename)
self.check_deprecated_module(node, basename)
class_names = (name for name, _ in node.names)
se... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 116 | get_import_name | ref | function | basename = get_import_name(node, basename)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 117 | check_deprecated_module | ref | function | self.check_deprecated_module(node, basename)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 119 | check_deprecated_class | ref | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 121 | deprecated_methods | def | function | def deprecated_methods(self) -> Container[str]:
"""Callback returning the deprecated methods/functions.
Returns:
collections.abc.Container of deprecated function/method names.
"""
# pylint: disable=no-self-use
return ()
def deprecated_arguments(self, method:... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 130 | deprecated_arguments | def | function | def deprecated_arguments(self, method: str) -> Iterable[tuple[int | None, str]]:
"""Callback returning the deprecated arguments of method/function.
Args:
method (str): name of function/method checked for deprecated arguments
Returns:
collections.abc.Iterable in form... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 157 | deprecated_modules | def | function | def deprecated_modules(self) -> Iterable:
"""Callback returning the deprecated modules.
Returns:
collections.abc.Container of deprecated module names.
"""
# pylint: disable=no-self-use
return ()
def deprecated_classes(self, module: str) -> Iterable:
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 166 | deprecated_classes | def | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 179 | check_deprecated_module | def | function | def check_deprecated_module(self, node, mod_path):
"""Checks if the module is deprecated."""
for mod_name in self.deprecated_modules():
if mod_path == mod_name or mod_path.startswith(mod_name + "."):
self.add_message("deprecated-module", node=node, args=mod_path)
def... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 181 | deprecated_modules | ref | function | for mod_name in self.deprecated_modules():
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 183 | add_message | ref | function | self.add_message("deprecated-module", node=node, args=mod_path)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 185 | check_deprecated_method | def | function | def check_deprecated_method(self, node, inferred):
"""Executes the checker for the given node.
This method should be called from the checker implementing this mixin.
"""
# Reject nodes which aren't of interest to us.
if not isinstance(inferred, ACCEPTABLE_NODES):
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 203 | qname | ref | function | if hasattr(inferred.parent, "qname") and inferred.parent.qname():
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 207 | qname | ref | function | inferred.qname(),
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 208 | qname | ref | function | f"{inferred.parent.qname()}.{func_name}",
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 212 | qname | ref | function | qnames = {inferred.qname(), func_name}
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 213 | deprecated_methods | ref | function | if any(name in self.deprecated_methods() for name in qnames):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 214 | add_message | ref | function | self.add_message("deprecated-method", node=node, args=(func_name,))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 218 | deprecated_arguments | ref | function | deprecated_arguments = (self.deprecated_arguments(qn) for qn in qnames)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 222 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 227 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 231 | check_deprecated_class | def | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 235 | deprecated_classes | ref | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 236 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 240 | check_deprecated_class_in_call | def | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/deprecated.py | pylint/checkers/deprecated.py | 248 | check_deprecated_class | ref | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 178 | _is_exempt_from_public_methods | def | function | def _is_exempt_from_public_methods(node: astroid.ClassDef) -> bool:
"""Check if a class is exempt from too-few-public-methods."""
# If it's a typing.Namedtuple, typing.TypedDict or an Enum
for ancestor in node.ancestors():
if ancestor.name == "Enum" and ancestor.root().name == "enum":
r... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 182 | ancestors | ref | function | for ancestor in node.ancestors():
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 183 | root | ref | function | if ancestor.name == "Enum" and ancestor.root().name == "enum":
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 185 | qname | ref | function | if ancestor.qname() in (TYPING_NAMEDTUPLE, TYPING_TYPEDDICT):
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 192 | root | ref | function | root_locals = set(node.root().locals)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 210 | _count_boolean_expressions | def | function | def _count_boolean_expressions(bool_op):
"""Counts the number of boolean expressions in BoolOp `bool_op` (recursive).
example: a and (b or c or (d and e)) ==> 5 boolean expressions
"""
nb_bool_expr = 0
for bool_expr in bool_op.get_children():
if isinstance(bool_expr, astroid.BoolOp):
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 216 | get_children | ref | function | for bool_expr in bool_op.get_children():
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 218 | _count_boolean_expressions | ref | function | nb_bool_expr += _count_boolean_expressions(bool_expr)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 224 | _count_methods_in_class | def | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 225 | methods | ref | function | all_methods = sum(1 for method in node.methods() if not method.name.startswith("_"))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 228 | mymethods | ref | function | for method in node.mymethods():
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 234 | _get_parents_iter | def | function | def _get_parents_iter(
node: nodes.ClassDef, ignored_parents: frozenset[str]
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 253 | ancestors | ref | function | to_explore = cast(List[nodes.ClassDef], list(node.ancestors(recurs=False)))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 256 | qname | ref | function | if parent.qname() in ignored_parents:
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 267 | ancestors | ref | function | to_explore.extend(parent.ancestors(recurs=False))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 270 | _get_parents | def | function | def _get_parents(
node: nodes.ClassDef, ignored_parents: frozenset[str]
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 273 | _get_parents_iter | ref | function | return set(_get_parents_iter(node, ignored_parents))
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 276 | MisdesignChecker | def | class | __init__ open _inc_all_stmts _ignored_argument_names visit_classdef leave_classdef visit_functiondef leave_functiondef visit_return visit_default visit_tryexcept visit_tryfinally visit_if _check_boolean_expressions visit_while _inc_branch |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 414 | reset_node_count | ref | function | self.linter.stats.reset_node_count()
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 422 | _inc_all_stmts | def | function | def _inc_all_stmts(self, amount):
for i, _ in enumerate(self._stmts):
self._stmts[i] += amount
@cached_property
def _ignored_argument_names(self):
return self.linter.config.ignored_argument_names
@only_required_for_messages(
"too-many-ancestors",
"too-many-i... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 427 | _ignored_argument_names | def | function | def _ignored_argument_names(self):
return self.linter.config.ignored_argument_names
@only_required_for_messages(
"too-many-ancestors",
"too-many-instance-attributes",
"too-few-public-methods",
"too-many-public-methods",
)
def visit_classdef(self, node: nodes.Clas... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 430 | only_required_for_messages | ref | function | @only_required_for_messages(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 436 | visit_classdef | def | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 438 | _get_parents | ref | function | parents = _get_parents(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 444 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 451 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 457 | only_required_for_messages | ref | function | @only_required_for_messages("too-few-public-methods", "too-many-public-methods")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 458 | leave_classdef | def | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 461 | mymethods | ref | function | 1 for method in node.mymethods() if not method.name.startswith("_")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 472 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 480 | ancestors | ref | function | for ancestor in node.ancestors():
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 482 | qname | ref | function | pattern.match(ancestor.qname())
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 489 | _is_exempt_from_public_methods | ref | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 495 | _count_methods_in_class | ref | class | |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 497 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 503 | only_required_for_messages | ref | function | @only_required_for_messages(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 511 | visit_functiondef | def | function | def visit_functiondef(self, node: nodes.FunctionDef) -> None:
"""Check function name, docstring, arguments, redefinition,
variable names, max locals.
"""
# init branch and returns counters
self._returns.append(0)
# check number of arguments
args = node.args.ar... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 529 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 544 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 554 | only_required_for_messages | ref | function | @only_required_for_messages(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 561 | leave_functiondef | def | function | def leave_functiondef(self, node: nodes.FunctionDef) -> None:
"""Most of the work is done here on close:
checks for max returns, branch, return in __init__.
"""
returns = self._returns.pop()
if returns > self.linter.config.max_returns:
self.add_message(
... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 567 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 574 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 582 | add_message | ref | function | self.add_message(
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 590 | visit_return | def | function | def visit_return(self, _: nodes.Return) -> None:
"""Count number of returns."""
if not self._returns:
return # return outside function, reported by the base checker
self._returns[-1] += 1
def visit_default(self, node: nodes.NodeNG) -> None:
"""Default visit method -... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 596 | visit_default | def | function | def visit_default(self, node: nodes.NodeNG) -> None:
"""Default visit method -> increments the statements counter if
necessary.
"""
if node.is_statement:
self._inc_all_stmts(1)
def visit_tryexcept(self, node: nodes.TryExcept) -> None:
"""Increments the branch... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 601 | _inc_all_stmts | ref | function | self._inc_all_stmts(1)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 603 | visit_tryexcept | def | function | def visit_tryexcept(self, node: nodes.TryExcept) -> None:
"""Increments the branches counter."""
branches = len(node.handlers)
if node.orelse:
branches += 1
self._inc_branch(node, branches)
self._inc_all_stmts(branches)
def visit_tryfinally(self, node: nodes.... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 608 | _inc_branch | ref | function | self._inc_branch(node, branches)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 609 | _inc_all_stmts | ref | function | self._inc_all_stmts(branches)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 611 | visit_tryfinally | def | function | def visit_tryfinally(self, node: nodes.TryFinally) -> None:
"""Increments the branches counter."""
self._inc_branch(node, 2)
self._inc_all_stmts(2)
@only_required_for_messages("too-many-boolean-expressions", "too-many-branches")
def visit_if(self, node: nodes.If) -> None:
""... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 613 | _inc_branch | ref | function | self._inc_branch(node, 2)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 614 | _inc_all_stmts | ref | function | self._inc_all_stmts(2)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 616 | only_required_for_messages | ref | function | @only_required_for_messages("too-many-boolean-expressions", "too-many-branches")
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 617 | visit_if | def | function | def visit_if(self, node: nodes.If) -> None:
"""Increments the branches counter and checks boolean expressions."""
self._check_boolean_expressions(node)
branches = 1
# don't double count If nodes coming from some 'elif'
if node.orelse and (
len(node.orelse) > 1 or ... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 619 | _check_boolean_expressions | ref | function | self._check_boolean_expressions(node)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 626 | _inc_branch | ref | function | self._inc_branch(node, branches)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 627 | _inc_all_stmts | ref | function | self._inc_all_stmts(branches)
|
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 629 | _check_boolean_expressions | def | function | def _check_boolean_expressions(self, node):
"""Go through "if" node `node` and count its boolean expressions
if the 'if' node test is a BoolOp node.
"""
condition = node.test
if not isinstance(condition, astroid.BoolOp):
return
nb_bool_expr = _count_boolea... |
playground/2af25c45-9624-42e9-b1b3-5ecb19e13cc8/pylint/pylint/checkers/design_analysis.py | pylint/checkers/design_analysis.py | 636 | _count_boolean_expressions | ref | function | nb_bool_expr = _count_boolean_expressions(condition)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.