ahawker/crython

View on GitHub

Showing 8 of 20 total issues

File field.py has 269 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""
    crython/field
    ~~~~~~~~~~~~~

    Contains functionality for representing an individual field within an expression.
Severity: Minor
Found in crython/field.py - About 2 hrs to fix

    Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, second, minute, hour, day, month, weekday, year, reboot=False, logger=None):
    Severity: Major
    Found in crython/expression.py - About 1 hr to fix

      Function run has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def run(self):
              """
              Background function that processes all registered jobs and invokes them based on their context and expression.
              """
              self.logger.info('{0} started'.format(self.name))
      Severity: Minor
      Found in crython/tab.py - About 1 hr 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 from_number has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def from_number(cls, value, name, min, max, specials, *args, **kwargs):
      Severity: Major
      Found in crython/field.py - About 50 mins to fix

        Function from_iterable has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def from_iterable(cls, value, name, min, max, specials, *args, **kwargs):
        Severity: Major
        Found in crython/field.py - About 50 mins to fix

          Function from_str has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def from_str(cls, value, name, min, max, specials, *args, **kwargs):
          Severity: Major
          Found in crython/field.py - About 50 mins to fix

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

                def __init__(self, value, name, min, max, specials):
            Severity: Minor
            Found in crython/field.py - About 35 mins to fix

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

              def _expression_str_to_dict(expression, expression_field_count=FIELD_COUNT, field_names=field.NAMES,
              Severity: Minor
              Found in crython/expression.py - About 35 mins to fix
                Severity
                Category
                Status
                Source
                Language