wohlgejm/accountable

View on GitHub

Showing 6 of 11 total issues

Function reshape has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def reshape(schema, data):
    reshaped = [] if isinstance(schema, MutableSequence) else OrderedDict()

    def _reshape(schema, data, new_data):
        if isinstance(schema, MutableMapping):
Severity: Minor
Found in accountable/utils.py - About 4 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File cli.py has 299 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from __future__ import absolute_import

from functools import update_wrapper
from operator import itemgetter
import textwrap
Severity: Minor
Found in accountable/cli.py - About 3 hrs to fix

    Function new_func has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def new_func(ctx, accountable, options, *args, **kwargs):
    Severity: Minor
    Found in accountable/cli.py - About 35 mins to fix

      Function flatten has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def flatten(d, parent_key='', sep='_'):
          items = []
          for k, v in d.items():
              new_key = (
                  underscore(parent_key) +
      Severity: Minor
      Found in accountable/utils.py - About 35 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function print_table has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def print_table(table):
          for row_idx, row in enumerate(table.table_data):
              for col_idx, _col in enumerate(row):
                  max_width = table.column_max_width(col_idx)
                  datum = table.table_data[row_idx][col_idx]
      Severity: Minor
      Found in accountable/cli.py - About 35 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function createmeta has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def createmeta(accountable, project_key, issue_type=None):
          """
          Create new issue.
          """
          metadata = accountable.create_meta(project_key, issue_type)
      Severity: Minor
      Found in accountable/cli.py - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Severity
      Category
      Status
      Source
      Language