auxilium/methods/root.py
Function do
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def do(command=None, demo=None, verbosity=None, exit_status=None, env=None,
Function start_demo
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
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. "
- Read upRead up
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
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:
- Read upRead up
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
Open
def start_demo(demo=DEMO_PATH, verbosity=0, exit_status=0, env=None, **kwargs):
Avoid too many return
statements within this function. Open
Open
return failure_exit(exit_status, command)