-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
Description
python-repo/pythonrepo/pythonrepo.py
Lines 99 to 115 in 72b82fa
| 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.