krassowski/declarative-parser

View on GitHub
declarative_parser/constructor_parser.py

Summary

Maintainability
C
7 hrs
Test Coverage

Function analyze has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    def analyze(self, docstring: str):
        """Analyze docstring and collect arguments with descriptions.

        All arguments have to start with a lowercase letter, be followed
        with a colon (:) and then with the description of the argument.
Severity: Minor
Found in declarative_parser/constructor_parser.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

Function __init__ has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, constructor, docstring_type='google', **kwargs):
        """Initializes parser analyzing provided class constructor.

        Arguments:
            constructor:
Severity: Minor
Found in declarative_parser/constructor_parser.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

Avoid deeply nested control flow statements.
Open

                        if value:
                            help_strings[argument].append(value)

Severity: Major
Found in declarative_parser/constructor_parser.py - About 45 mins to fix

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

        def __init__(self, argument_definition, argument_sections, inline=False, indent_sensitive=False, skip=None):
    Severity: Minor
    Found in declarative_parser/constructor_parser.py - About 35 mins to fix

      There are no issues that match your filters.

      Category
      Status