Showing 7 of 11 total issues
Function _run_task
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def _run_task(
fn, id, interval, times, start_in, kwargs, debug,
on_success, on_error, on_iter, on_finished
):
callback_result = None
- 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 _run_task
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def _run_task(
Function get_seconds
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_seconds(interval):
"""
Returns seconds which is time * scale.
If interval is a number or None then it will be returned as is.
- 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 __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, task_id, fn, kwargs, executor, debug):
Function _get_results
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_results(fn, kwargs, iterations, times, debug):
Function __clean_tasks_list
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __clean_tasks_list(self):
"""
Removes all finished tasks from the tasks list.
Returns the cleaned tasks list.
"""
- 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 _get_results
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _get_results(fn, kwargs, iterations, times, debug):
"""
Runs the task and catches any exceptions that might occur. Passes the
runium parameter if the task accepts one.
Returns:
- 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"