File localstack.py
has 709 lines of code (exceeds 250 allowed). Consider refactoring. Open
import json
import logging
import os
import sys
import traceback
Function invoke
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def invoke(self, ctx: click.Context):
try:
return super(LocalStackCliGroup, self).invoke(ctx)
except click.exceptions.Exit:
# raise Exit exceptions unmodified (e.g., raised on --help)
- Read upRead up
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 format_commands
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def format_commands(self, ctx: click.Context, formatter: click.HelpFormatter) -> None:
"""Extra format methods for multi methods that adds all the commands after the options. It also
groups commands into command categories."""
categories = {"Commands": [], "Advanced": [], "Deprecated": []}
- Read upRead up
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 cmd_start
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def cmd_start(
Function _print_docker_status
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _print_docker_status(format_: str) -> None:
from localstack.utils import docker_utils
from localstack.utils.bootstrap import get_docker_image_details, get_server_version
from localstack.utils.container_networking import get_main_container_ip, get_main_container_name
- Read upRead up
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 cmd_config_show
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def cmd_config_show(format_: str) -> None:
"""
Print the current LocalStack config values.
This command prints the LocalStack configuration values from your environment.
- Read upRead up
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"