File provider.py
has 2384 lines of code (exceeds 250 allowed). Consider refactoring. Open
import copy
import io
import json
import logging
import re
ApigatewayProvider
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
class ApigatewayProvider(ApigatewayApi, ServiceLifecycleHook):
router: ApigatewayRouter | ApiGatewayRouterNextGen
def __init__(self, router: ApigatewayRouter | ApiGatewayRouterNextGen = None):
self.router = router or ApigatewayRouter(ROUTER)
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,
- 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 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,
- 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 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,
- 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 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,
- 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 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,
- 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 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,
- 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 create_domain_name
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_domain_name(
Function put_method
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def put_method(
Function create_api_key
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_api_key(
Function create_usage_plan
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_usage_plan(
Function get_api_keys
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_api_keys(
Function create_model
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_model(
Function put_gateway_response
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def put_gateway_response(
Function get_export
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_export(
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,
- 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 update_integration_response
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_integration_response(
Function create_base_path_mapping
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_base_path_mapping(
Function update_integration
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_integration(
Function get_integration_response
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_integration_response(
Function create_documentation_version
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_documentation_version(
Function create_vpc_link
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_vpc_link(
Function create_request_validator
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_request_validator(
Function import_documentation_parts
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def import_documentation_parts(
Function get_method_response
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_method_response(
Function update_method
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_method(
Function get_base_path_mappings
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_base_path_mappings(
Function update_base_path_mapping
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_base_path_mapping(
Function get_integration
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_integration(
Function get_tags
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_tags(
Function get_usage_plans
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_usage_plans(
Function update_documentation_part
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_documentation_part(
Function update_model
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_model(
Function get_request_validators
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_request_validators(
Function get_models
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_models(
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,
- 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 get_gateway_responses
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_gateway_responses(
Function import_rest_api
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def import_rest_api(
Function get_model
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_model(
Function update_gateway_response
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_gateway_response(
Function get_documentation_versions
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_documentation_versions(
Function delete_integration
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def delete_integration(
Avoid deeply nested control flow statements. Open
if integration_response.response_parameters == {}:
method_integration["integrationResponses"][str(status_code)][
"responseParameters"
] = {}
Function update_request_validator
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_request_validator(
Function update_documentation_version
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_documentation_version(
Function get_method
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_method(
Function get_authorizers
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_authorizers(
Function delete_method
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def delete_method(
Function update_resource
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_resource(
Function update_deployment
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_deployment(
Function update_stage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_stage(
Function create_resource
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_resource(
Function update_authorizer
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_authorizer(
Function generate_client_certificate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_client_certificate(
Function delete_gateway_response
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def delete_gateway_response(
Function update_client_certificate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_client_certificate(
Function delete_documentation_version
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def delete_documentation_version(
Function update_api_key
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_api_key(
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):
Function create_documentation_part
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_documentation_part(
Function update_vpc_link
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_vpc_link(
Function delete_request_validator
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def delete_request_validator(
Function get_client_certificates
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_client_certificates(
Function update_usage_plan
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_usage_plan(
Function get_request_validator
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_request_validator(
Function tag_resource
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def tag_resource(
Function delete_documentation_part
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def delete_documentation_part(
Function get_gateway_response
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_gateway_response(
Function get_documentation_version
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_documentation_version(
Function get_vpc_links
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_vpc_links(
Function delete_model
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def delete_model(
Function delete_base_path_mapping
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def delete_base_path_mapping(
Function get_base_path_mapping
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_base_path_mapping(
Function untag_resource
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def untag_resource(
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,
- 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 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,
- 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"