dev-pipeline/dev-pipeline-configure

View on GitHub
lib/devpipeline_configure/load.py

Summary

Maintainability
B
5 hrs
Test Coverage

Function _profiles_changed has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def _profiles_changed(config, cache_mtime):
    default_config = config.get("DEFAULT")
    profile_list = default_config.get_list("dp.profile_name")
    if profile_list:
        if os.path.isdir(
Severity: Minor
Found in lib/devpipeline_configure/load.py - About 3 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

Avoid deeply nested control flow statements.
Open

                    if os.path.isfile(profile_path):
                        if cache_mtime < os.path.getmtime(profile_path):
                            return True
        else:
Severity: Major
Found in lib/devpipeline_configure/load.py - About 45 mins to fix

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

    def _check_specific_override(
    Severity: Minor
    Found in lib/devpipeline_configure/load.py - About 35 mins to fix

      Function _overrides_changed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def _overrides_changed(config, cache_mtime):
          default_config = config.get("DEFAULT")
          override_list = default_config.get_list("dp.overrides")
          for component_name, component_config in config.items():
              applied_overrides = component_config.get_list("dp.applied_overrides")
      Severity: Minor
      Found in lib/devpipeline_configure/load.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

      Function _check_specific_override has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def _check_specific_override(
          override_name, applied_overrides, component_config, component_name, cache_mtime
      ):
          override_path = devpipeline_configure.overrides.get_override_path(
              component_config, override_name, component_name
      Severity: Minor
      Found in lib/devpipeline_configure/load.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

      There are no issues that match your filters.

      Category
      Status