pyarmory/aumbry

View on GitHub

Showing 5 of 5 total issues

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

    def dict_to_params(self, input_dict, prefix, source, params):
        mapping = get_normalized_map(source)

        for key, val in input_dict.items():
            path = '{}/{}'.format(prefix, key)
Severity: Minor
Found in aumbry/sources/param_store.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 has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def load(source_name, config_class, options=None, search_paths=None,
Severity: Minor
Found in aumbry/loader.py - About 45 mins to fix

    Function save has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def save(source_name, config_inst, options=None, search_paths=None,
    Severity: Minor
    Found in aumbry/loader.py - About 45 mins to fix

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

          def import_requirements(self):
              def _import(req, pkg=None):
                  try:
                      importlib.import_module(req, pkg)
                  except BaseException:
      Severity: Minor
      Found in aumbry/contract.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 merge has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def merge(config_class, sources, preprocessor=None, handler=None):
          """Loads a configuration from multiple sources into the specified Config
          type. Each source has to be the same type.
      
          Args:
      Severity: Minor
      Found in aumbry/loader.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