localstack/localstack

View on GitHub
localstack-core/localstack/dev/run/configurators.py

Summary

Maintainability
B
5 hrs
Test Coverage

File configurators.py has 271 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""
Several ContainerConfigurator implementations to set up a development version of a localstack container.
"""

import gzip
Severity: Minor
Found in localstack-core/localstack/dev/run/configurators.py - About 2 hrs to fix

    Function __call__ has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def __call__(self, cfg: ContainerConfiguration):
            # locate all relevant dependency directories
            pattern = self.dependency_glob
            files = _list_files_in_container_image(DOCKER_CLIENT, cfg.image_name)
            paths = [PurePosixPath(f) for f in files]
    Severity: Minor
    Found in localstack-core/localstack/dev/run/configurators.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 __call__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def __call__(self, cfg: ContainerConfiguration):
            # localstack source code if available
            source = self.host_paths.localstack_project_dir / "localstack-core" / "localstack"
            if source.exists():
                cfg.volumes.add(
    Severity: Minor
    Found in localstack-core/localstack/dev/run/configurators.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 __call__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def __call__(self, cfg: ContainerConfiguration):
            # special case for community code
            if not self.pro:
                host_path = (
                    self.host_paths.localstack_project_dir
    Severity: Minor
    Found in localstack-core/localstack/dev/run/configurators.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