Skip to content

Commit

Permalink
Fix: Added _ at the beginning of a public attribute in class _Complex…
Browse files Browse the repository at this point in the history
…ityCounter(object). Issue #14
  • Loading branch information
iZafiro committed Feb 25, 2020
1 parent d8b3eef commit 1a26d22
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions wemake_python_styleguide/visitors/ast/complexity/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(self) -> None:
self.variables: DefaultDict[AnyFunctionDef, List[str]] = defaultdict(
list,
)
self.exit_metrics: _ComplexityExitMetrics()
self._exit_metrics: _ComplexityExitMetrics()

def check_arguments_count(self, node: AnyFunctionDefAndLambda) -> None:
"""Checks the number of the arguments in a function."""
Expand Down Expand Up @@ -111,11 +111,11 @@ def _check_sub_node(
self._update_variables(node, sub_node)

error_counters: _NodeTypeHandler = {
ast.Return: self.exit_metrics.returns,
ast.Return: self._exit_metrics.returns,
ast.Expr: self.expressions,
ast.Await: self.awaits,
ast.Assert: self.asserts,
ast.Raise: self.exit_metrics.raises,
ast.Raise: self._exit_metrics.raises,
}

for types, counter in error_counters.items():
Expand Down Expand Up @@ -211,7 +211,7 @@ def _function_checks(self) -> List[_CheckRule]:
TooManyArgumentsViolation,
),
(
self._counter.exit_metrics.returns,
self._counter._exit_metrics.returns,
self.options.max_returns,
TooManyReturnsViolation,
),
Expand All @@ -226,7 +226,7 @@ def _function_checks(self) -> List[_CheckRule]:
TooManyAssertsViolation,
),
(
self._counter.exit_metrics.raises,
self._counter._exit_metrics.raises,
self.options.max_raises,
TooManyRaisesViolation,
),
Expand Down

0 comments on commit 1a26d22

Please sign in to comment.