AGTGreg/runium

View on GitHub

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
Severity: Minor
Found in runium/core.py - About 2 hrs 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 _run_task has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

def _run_task(
Severity: Major
Found in runium/core.py - About 1 hr to fix

    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.
    
    
    Severity: Minor
    Found in runium/util.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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, task_id, fn, kwargs, executor, debug):
    Severity: Minor
    Found in runium/core.py - About 35 mins to fix

      Function _get_results has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def _get_results(fn, kwargs, iterations, times, debug):
      Severity: Minor
      Found in runium/core.py - About 35 mins to fix

        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.
                """
        Severity: Minor
        Found in runium/core.py - About 35 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 _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:
        Severity: Minor
        Found in runium/core.py - About 25 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

        Severity
        Category
        Status
        Source
        Language