endremborza/aswan

View on GitHub
aswan/depot/base.py

Summary

Maintainability
C
1 day
Test Coverage

File base.py has 362 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import os
import pickle
import sys
import time
import zipfile
Severity: Minor
Found in aswan/depot/base.py - About 4 hrs to fix

    Function get_handler_events has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_handler_events(
            self,
            handler: Optional[Union[str, ANY_HANDLER_T]] = None,
            only_successful=True,
            only_latest=True,
    Severity: Minor
    Found in aswan/depot/base.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 cleanup_statuses has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def cleanup_statuses(self):
            errs = {}
            err_set = set()
            while True:
                for st in self.statuses_path.iterdir():
    Severity: Minor
    Found in aswan/depot/base.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 _get_leaf has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def _get_leaf(self, needs_db=False):
            # just one that has no children
            # and has the most runs in its tree
            most_runs = 0
            leaf, leaf_tree = Status(), set()
    Severity: Minor
    Found in aswan/depot/base.py - About 45 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_handler_events has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def get_handler_events(
    Severity: Minor
    Found in aswan/depot/base.py - About 45 mins to fix

      There are no issues that match your filters.

      Category
      Status