localstack/localstack

View on GitHub

Showing 3,177 of 3,177 total issues

Avoid too many return statements within this function.
Open

            return azs

    Avoid too many return statements within this function.
    Open

            return "elbv2"
    Severity: Major
    Found in localstack-core/localstack/services/cloudformation/resource_provider.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return "resource-groups"
      Severity: Major
      Found in localstack-core/localstack/services/cloudformation/resource_provider.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return "application-autoscaling"
        Severity: Major
        Found in localstack-core/localstack/services/cloudformation/resource_provider.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return "es"
          Severity: Major
          Found in localstack-core/localstack/services/cloudformation/resource_provider.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return "kafka"
            Severity: Major
            Found in localstack-core/localstack/services/cloudformation/resource_provider.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return False

                Avoid too many return statements within this function.
                Open

                        return "acm"
                Severity: Major
                Found in localstack-core/localstack/services/cloudformation/resource_provider.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return "timestream-write"
                  Severity: Major
                  Found in localstack-core/localstack/services/cloudformation/resource_provider.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return format_name_to_path(handler_name, ".", ".py")
                    Severity: Major
                    Found in localstack-core/localstack/services/lambda_/lambda_utils.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return "opensearch"
                      Severity: Major
                      Found in localstack-core/localstack/services/cloudformation/resource_provider.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return "elb"
                        Severity: Major
                        Found in localstack-core/localstack/services/cloudformation/resource_provider.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return True

                            Avoid too many return statements within this function.
                            Open

                                return False

                              Avoid too many return statements within this function.
                              Open

                                      return format_name_to_path(handler_name, ".", ".rb")
                              Severity: Major
                              Found in localstack-core/localstack/services/lambda_/lambda_utils.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                    return parts[1].lower()
                                Severity: Major
                                Found in localstack-core/localstack/services/cloudformation/resource_provider.py - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                      return None
                                  Severity: Major
                                  Found in localstack-core/localstack/cli/profiles.py - About 30 mins to fix

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

                                        def __init__(
                                            self,
                                            mount: str = None,
                                            submount: str | None = _default,
                                            subdomain: str | None = _default,
                                    Severity: Minor
                                    Found in localstack-core/localstack/extensions/patterns/webapp.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 pytest_sessionstart has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    def pytest_sessionstart(session: "Session") -> None:
                                        Path(BASE_PATH).mkdir(parents=True, exist_ok=True)
                                        pattern = re.compile("--junitxml=(.*)\\.xml")
                                        if session.config.invocation_params:
                                            for ip in session.config.invocation_params.args:
                                    Severity: Minor
                                    Found in localstack-core/localstack/testing/pytest/metric_collection.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 fetch_events has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    def fetch_events(role_arn: str, start_time: str, end_time: str) -> List[dict]:
                                        print(f"fetching cloudtrail events for role {role_arn} from {start_time=} to {end_time=}")
                                        client = get_client("cloudtrail")
                                        paginator = client.get_paginator("lookup_events")
                                    
                                    

                                    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