Skip to content

Function useTool has a Cognitive Complexity of 6 (exceeds 5 allowed).  #25

@reactive-firewall

Description

@reactive-firewall

def useTool(tool, arguments=None):
"""Handler for launching the functions."""
if arguments is None:
arguments = [None]
if tool is None:
return None
if tool in TASK_OPTIONS.keys():
try:
# print(str("launching: " + tool))
TASK_OPTIONS[tool](arguments)
except Exception:
print(str(
"WARNING - An error occured while" +
"handling the shell. Cascading failure."
))
else:
return None

Function useTool has a Cognitive Complexity of 6 (exceeds 5 allowed).

This should be reduced by breaking up some of the function into smaller simpler functions or reducing the Cognitive jumps.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions