sonntagsgesicht/auxilium

View on GitHub
auxilium/methods/root.py

Summary

Maintainability
B
4 hrs
Test Coverage

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

def do(command=None, demo=None, verbosity=None, exit_status=None, env=None,
Severity: Major
Found in auxilium/methods/root.py - About 1 hr to fix

    Function start_demo has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def start_demo(demo=DEMO_PATH, verbosity=0, exit_status=0, env=None, **kwargs):
        logging.log(logging.INFO, ICONS["demo"] + 'relax, just starting a demo')
        if exists(demo):
            yn = input(" " + ICONS["warn"] +
                       "demo path exists. "
    Severity: Minor
    Found in auxilium/methods/root.py - About 55 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 do has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def do(command=None, demo=None, verbosity=None, exit_status=None, env=None,
           pre=None, pkg=None, path=None, **kwargs):
        exit = int if exit_status < 0 else sys.exit
        # check demo
        if demo:
    Severity: Minor
    Found in auxilium/methods/root.py - About 55 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 start_demo has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def start_demo(demo=DEMO_PATH, verbosity=0, exit_status=0, env=None, **kwargs):
    Severity: Minor
    Found in auxilium/methods/root.py - About 35 mins to fix

      Avoid too many return statements within this function.
      Open

              return failure_exit(exit_status, command)
      Severity: Major
      Found in auxilium/methods/root.py - About 30 mins to fix

        There are no issues that match your filters.

        Category
        Status