localstack/localstack

View on GitHub
localstack/services/apigateway/provider.py

Summary

Maintainability
F
2 wks
Test Coverage

File provider.py has 2394 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import copy
import io
import json
import logging
import re
Severity: Major
Found in localstack/services/apigateway/provider.py - About 6 days to fix

    ApigatewayProvider has 40 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ApigatewayProvider(ApigatewayApi, ServiceLifecycleHook):
        router: ApigatewayRouter
    
        def __init__(self, router: ApigatewayRouter = None):
            self.router = router or ApigatewayRouter(ROUTER)
    Severity: Minor
    Found in localstack/services/apigateway/provider.py - About 5 hrs to fix

      Function update_method has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          def update_method(
              self,
              context: RequestContext,
              rest_api_id: String,
              resource_id: String,
      Severity: Minor
      Found in localstack/services/apigateway/provider.py - About 5 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

      Function update_rest_api has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

          def update_rest_api(
              self,
              context: RequestContext,
              rest_api_id: String,
              patch_operations: ListOfPatchOperation = None,
      Severity: Minor
      Found in localstack/services/apigateway/provider.py - About 4 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

      Function update_resource has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

          def update_resource(
              self,
              context: RequestContext,
              rest_api_id: String,
              resource_id: String,
      Severity: Minor
      Found in localstack/services/apigateway/provider.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

      Function put_method has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def put_method(
              self,
              context: RequestContext,
              rest_api_id: String,
              resource_id: String,
      Severity: Minor
      Found in localstack/services/apigateway/provider.py - About 2 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

      Function update_stage has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          def update_stage(
              self,
              context: RequestContext,
              rest_api_id: String,
              stage_name: String,
      Severity: Minor
      Found in localstack/services/apigateway/provider.py - About 2 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

      Function get_method has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_method(
              self,
              context: RequestContext,
              rest_api_id: String,
              resource_id: String,
      Severity: Minor
      Found in localstack/services/apigateway/provider.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 create_domain_name has 15 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def create_domain_name(
      Severity: Major
      Found in localstack/services/apigateway/provider.py - About 1 hr to fix

        Function put_method has 13 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def put_method(
        Severity: Major
        Found in localstack/services/apigateway/provider.py - About 1 hr to fix

          Function create_api_key has 10 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def create_api_key(
          Severity: Major
          Found in localstack/services/apigateway/provider.py - About 1 hr to fix

            Function create_usage_plan has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def create_usage_plan(
            Severity: Major
            Found in localstack/services/apigateway/provider.py - About 1 hr to fix

              Function put_gateway_response has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def put_gateway_response(
              Severity: Major
              Found in localstack/services/apigateway/provider.py - About 1 hr to fix

                Function get_api_keys has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def get_api_keys(
                Severity: Major
                Found in localstack/services/apigateway/provider.py - About 1 hr to fix

                  Function create_model has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def create_model(
                  Severity: Major
                  Found in localstack/services/apigateway/provider.py - About 1 hr to fix

                    Function get_export has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def get_export(
                    Severity: Major
                    Found in localstack/services/apigateway/provider.py - About 1 hr to fix

                      Function update_integration_response has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def update_integration_response(
                              self,
                              context: RequestContext,
                              rest_api_id: String,
                              resource_id: String,
                      Severity: Minor
                      Found in localstack/services/apigateway/provider.py - About 55 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 update_integration_response has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def update_integration_response(
                      Severity: Major
                      Found in localstack/services/apigateway/provider.py - About 50 mins to fix

                        Function update_integration has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def update_integration(
                        Severity: Major
                        Found in localstack/services/apigateway/provider.py - About 50 mins to fix

                          Function import_documentation_parts has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def import_documentation_parts(
                          Severity: Major
                          Found in localstack/services/apigateway/provider.py - About 50 mins to fix

                            Function create_vpc_link has 7 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def create_vpc_link(
                            Severity: Major
                            Found in localstack/services/apigateway/provider.py - About 50 mins to fix

                              Function get_integration_response has 7 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def get_integration_response(
                              Severity: Major
                              Found in localstack/services/apigateway/provider.py - About 50 mins to fix

                                Function create_base_path_mapping has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def create_base_path_mapping(
                                Severity: Major
                                Found in localstack/services/apigateway/provider.py - About 50 mins to fix

                                  Function create_documentation_version has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def create_documentation_version(
                                  Severity: Major
                                  Found in localstack/services/apigateway/provider.py - About 50 mins to fix

                                    Function create_request_validator has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def create_request_validator(
                                    Severity: Major
                                    Found in localstack/services/apigateway/provider.py - About 50 mins to fix

                                      Function update_documentation_part has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          def update_documentation_part(
                                      Severity: Minor
                                      Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                        Function update_base_path_mapping has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                            def update_base_path_mapping(
                                        Severity: Minor
                                        Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                          Function get_integration has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                              def get_integration(
                                          Severity: Minor
                                          Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                            Function get_base_path_mappings has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                                def get_base_path_mappings(
                                            Severity: Minor
                                            Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                              Function get_request_validators has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                              Open

                                                  def get_request_validators(
                                              Severity: Minor
                                              Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                                Function update_method has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                Open

                                                    def update_method(
                                                Severity: Minor
                                                Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                                  Function import_rest_api has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                  Open

                                                      def import_rest_api(
                                                  Severity: Minor
                                                  Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                                    Function get_method_response has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                    Open

                                                        def get_method_response(
                                                    Severity: Minor
                                                    Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                                      Function get_documentation_versions has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                      Open

                                                          def get_documentation_versions(
                                                      Severity: Minor
                                                      Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                                        Function get_tags has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                        Open

                                                            def get_tags(
                                                        Severity: Minor
                                                        Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                                          Function update_documentation_version has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                          Open

                                                              def update_documentation_version(
                                                          Severity: Minor
                                                          Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                                            Function delete_integration has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                            Open

                                                                def delete_integration(
                                                            Severity: Minor
                                                            Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                                              Function update_request_validator has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                              Open

                                                                  def update_request_validator(
                                                              Severity: Minor
                                                              Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                                                Function get_model has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                Open

                                                                    def get_model(
                                                                Severity: Minor
                                                                Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                                                  Function get_models has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                  Open

                                                                      def get_models(
                                                                  Severity: Minor
                                                                  Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                                                    Function get_usage_plans has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                    Open

                                                                        def get_usage_plans(
                                                                    Severity: Minor
                                                                    Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                                                      Function update_gateway_response has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                      Open

                                                                          def update_gateway_response(
                                                                      Severity: Minor
                                                                      Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                                                        Function update_model has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                        Open

                                                                            def update_model(
                                                                        Severity: Minor
                                                                        Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                                                          Function get_gateway_responses has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                          Open

                                                                              def get_gateway_responses(
                                                                          Severity: Minor
                                                                          Found in localstack/services/apigateway/provider.py - About 45 mins to fix

                                                                            Function create_resource has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                            Open

                                                                                def create_resource(
                                                                                    self,
                                                                                    context: RequestContext,
                                                                                    rest_api_id: String,
                                                                                    parent_id: String,
                                                                            Severity: Minor
                                                                            Found in localstack/services/apigateway/provider.py - About 45 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

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                                    if integration_response.response_parameters == {}:
                                                                                                        method_integration["integrationResponses"][str(status_code)][
                                                                                                            "responseParameters"
                                                                                                        ] = {}
                                                                            
                                                                            
                                                                            Severity: Major
                                                                            Found in localstack/services/apigateway/provider.py - About 45 mins to fix

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

                                                                                  def get_documentation_version(
                                                                              Severity: Minor
                                                                              Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                    def generate_client_certificate(
                                                                                Severity: Minor
                                                                                Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                      def delete_request_validator(
                                                                                  Severity: Minor
                                                                                  Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                        def update_deployment(
                                                                                    Severity: Minor
                                                                                    Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                          def get_authorizers(
                                                                                      Severity: Minor
                                                                                      Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                            def create_documentation_part(
                                                                                        Severity: Minor
                                                                                        Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                              def delete_documentation_part(
                                                                                          Severity: Minor
                                                                                          Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                def create_resource(
                                                                                            Severity: Minor
                                                                                            Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                  def update_stage(
                                                                                              Severity: Minor
                                                                                              Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                    def update_authorizer(
                                                                                                Severity: Minor
                                                                                                Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                      def get_vpc_links(
                                                                                                  Severity: Minor
                                                                                                  Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                        def delete_base_path_mapping(
                                                                                                    Severity: Minor
                                                                                                    Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                          def tag_resource(
                                                                                                      Severity: Minor
                                                                                                      Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                            def get_base_path_mapping(
                                                                                                        Severity: Minor
                                                                                                        Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                              def get_client_certificates(
                                                                                                          Severity: Minor
                                                                                                          Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                                def update_vpc_link(
                                                                                                            Severity: Minor
                                                                                                            Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                                  def update_resource(
                                                                                                              Severity: Minor
                                                                                                              Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                                    def get_method(
                                                                                                                Severity: Minor
                                                                                                                Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                                      def untag_resource(
                                                                                                                  Severity: Minor
                                                                                                                  Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                                        def delete_method(
                                                                                                                    Severity: Minor
                                                                                                                    Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                                          def delete_documentation_version(
                                                                                                                      Severity: Minor
                                                                                                                      Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                                            def update_client_certificate(
                                                                                                                        Severity: Minor
                                                                                                                        Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                                              def get_request_validator(
                                                                                                                          Severity: Minor
                                                                                                                          Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                                                def update_usage_plan(
                                                                                                                            Severity: Minor
                                                                                                                            Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                                              def to_response_json(model_type, data, api_id=None, self_link=None, id_attr=None):
                                                                                                                              Severity: Minor
                                                                                                                              Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                                                    def delete_model(
                                                                                                                                Severity: Minor
                                                                                                                                Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                                                      def get_gateway_response(
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                                                        def update_api_key(
                                                                                                                                    Severity: Minor
                                                                                                                                    Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                                                          def delete_gateway_response(
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in localstack/services/apigateway/provider.py - About 35 mins to fix

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

                                                                                                                                            def update_documentation_part(
                                                                                                                                                self,
                                                                                                                                                context: RequestContext,
                                                                                                                                                rest_api_id: String,
                                                                                                                                                documentation_part_id: String,
                                                                                                                                        Severity: Minor
                                                                                                                                        Found in localstack/services/apigateway/provider.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 update_deployment has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                        Open

                                                                                                                                            def update_deployment(
                                                                                                                                                self,
                                                                                                                                                context: RequestContext,
                                                                                                                                                rest_api_id: String,
                                                                                                                                                deployment_id: String,
                                                                                                                                        Severity: Minor
                                                                                                                                        Found in localstack/services/apigateway/provider.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