dev-pipeline/devpipeline-core

View on GitHub
lib/devpipeline_core/sanitizer.py

Summary

Maintainability
A
50 mins
Test Coverage

Function _sanitize_empty_depends has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Wontfix

def _sanitize_empty_depends(configuration, error_fn):
    for name, component in configuration.items():
        depends_keys = _get_depends_keys(component)
        for depends_key in depends_keys:
            for dep in component.get_list(depends_key):
Severity: Minor
Found in lib/devpipeline_core/sanitizer.py - About 1 hr 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 _sanitize_legacy_depends has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _sanitize_legacy_depends(configuration, error_fn):
    for name, component in configuration.items():
        if "depends" in component:
            if not _get_depends_keys(component):
                error_fn("{} uses a deprecated key (depends)".format(name))
Severity: Minor
Found in lib/devpipeline_core/sanitizer.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_implicit_depends has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _check_implicit_depends(component, depends_keys, key, error_fn):
    val = component.get(key, raw=True)
    match = _IMPLICIT_PATTERN.search(val)
    if match:
        dep = match.group(1)
Severity: Minor
Found in lib/devpipeline_core/sanitizer.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