release-engineering/ubi-config

View on GitHub

Showing 5 of 76 total issues

Function load_all has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def load_all(self):
        ubi_configs = []
        for f in self._files_branch_map:
            for branch_sha1 in self._files_branch_map[f]:
                LOG.debug("Now loading %s from branch %s", f, branch_sha1[0])
Severity: Minor
Found in ubiconfig/_impl/loaders/gitlab.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 load_all has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def load_all(self):
        """Load all config file from a local directory and all its subdirectories"""

        ubi_configs = []
        self._isroot = True
Severity: Minor
Found in ubiconfig/_impl/loaders/local.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 _pre_load has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _pre_load(self):
        """Iterate all branches to get a mapping of {file_path: (branch, sha1)...}"""
        files_branch_map = {}

        LOG.debug("Loading config files from all branches")
Severity: Minor
Found in ubiconfig/_impl/loaders/gitlab.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 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, cs, pkgs, mds, file_name, version, flags):
Severity: Minor
Found in ubiconfig/config_types/__init__.py - About 45 mins to fix

    Function load has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def load(self, file_name, version=None):
            """Load file from remote repository.
            :param file_name: filename that is on remote repository in any branch
            :param version: name of remote branch
            """
    Severity: Minor
    Found in ubiconfig/_impl/loaders/gitlab.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

    Severity
    Category
    Status
    Source
    Language