Showing 3,154 of 3,154 total issues
Function has_data_filter_criteria
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def has_data_filter_criteria(filters: list[FilterCriteria]) -> bool:
for filter in filters:
for rule in filter.get("Filters", []):
parsed_pattern = json.loads(rule["Pattern"])
if "data" in parsed_pattern:
- 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 load_moto_routing_table
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_moto_routing_table(service: str) -> Map:
"""
Creates from moto service url_paths a werkzeug URL rule map that can be used to locate moto methods to dispatch
requests to.
- 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 message_attributes_to_lower
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def message_attributes_to_lower(message_attrs):
"""Convert message attribute details (first characters) to lower case (e.g., stringValue, dataType)."""
message_attrs = message_attrs or {}
for _, attr in message_attrs.items():
if not isinstance(attr, dict):
- 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_handler_file_from_name
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_handler_file_from_name(handler_name: str, runtime: str = None):
# Previously used DEFAULT_LAMBDA_RUNTIME here but that is only relevant for testing and this helper is still used in
# a CloudFormation model in localstack.services.cloudformation.models.lambda_.LambdaFunction.get_lambda_code_param
runtime = runtime or Runtime.python3_9
- 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 comparison_composite
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def comparison_composite(self):
localctx = ASLParser.Comparison_compositeContext(self, self._ctx, self.state)
self.enterRule(localctx, 96, self.RULE_comparison_composite)
self._la = 0 # Token type
- 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 iterator_decl_item
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def iterator_decl_item(self):
localctx = ASLParser.Iterator_decl_itemContext(self, self._ctx, self.state)
self.enterRule(localctx, 122, self.RULE_iterator_decl_item)
try:
- 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_provisioned_concurrency_config
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_provisioned_concurrency_config(
self, provisioned_concurrent_executions: int
) -> Future[None]:
"""
TODO: implement update while in progress (see test_provisioned_concurrency test)
- 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 catcher_stmt
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def catcher_stmt(self):
localctx = ASLParser.Catcher_stmtContext(self, self._ctx, self.state)
self.enterRule(localctx, 166, self.RULE_catcher_stmt)
try:
- 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 process_failure_destination
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_failure_destination(
self,
sqs_invocation: SQSInvocation,
invocation_result: InvocationResult,
event_invoke_config: EventInvokeConfig | 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 start
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def start(self) -> None:
"""
Starting the runtime environment
"""
with self.status_lock:
- 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 comparison_variable_stmt
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def comparison_variable_stmt(self):
localctx = ASLParser.Comparison_variable_stmtContext(self, self._ctx, self.state)
self.enterRule(localctx, 92, self.RULE_comparison_variable_stmt)
try:
- 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 prepare_image
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def prepare_image(function_version: FunctionVersion, platform: DockerPlatform) -> None:
if not function_version.config.runtime:
raise NotImplementedError(
"Custom images are currently not supported with image prebuilding"
)
- 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 item_processor_item
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def item_processor_item(self):
localctx = ASLParser.Item_processor_itemContext(self, self._ctx, self.state)
self.enterRule(localctx, 106, self.RULE_item_processor_item)
try:
- 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 runtimes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def runtimes(self, request: Request) -> LambdaRuntimesResponse:
"""This metadata endpoint needs to be loaded before the Lambda provider.
It can be used by the Webapp to query supported Lambda runtimes of an unknown LocalStack version."""
query_params = urllib.parse.parse_qs(request.environ["QUERY_STRING"])
# Query parameter values are all lists. Example: { "filter": ["all"] }
- 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_config_for_url
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_config_for_url(store: "LambdaStore", url_id: str) -> "Optional[FunctionUrlConfig]":
"""
Get a config object when resolving a URL
:param store: Lambda Store
- 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 add
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add(self, instance: Any) -> None:
inst_type = type(instance)
# End-Next conflicts:
if inst_type == End and Next in self._instance_by_type:
- 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 to_payload_type
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_payload_type(payload: Any) -> Optional[bytes]:
if isinstance(payload, bytes):
return payload
if payload is 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 _set_active_workers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _set_active_workers(self, workers_number: int, env: Environment) -> None:
with self._mutex:
current_workers_number = len(self._workers)
workers_diff = workers_number - current_workers_number
if workers_diff > 0:
- 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 on_terminated
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def on_terminated(self, env: Environment):
if self._termination_event.is_set():
return
with self._mutex:
end_program_state: ProgramState = env.program_state()
- 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 visitStates_decl
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def visitStates_decl(self, ctx: ASLParser.States_declContext) -> States:
states = States()
for child in ctx.children:
cmp: Optional[Component] = self.visit(child)
if isinstance(cmp, CommonStateField):
- 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"