File utils.py
has 503 lines of code (exceeds 250 allowed). Consider refactoring. Open
import json
import logging
import os
from typing import Callable, Final, Optional
Function create_and_record_logs
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_and_record_logs(
Function create_and_record_events
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_and_record_events(
Function create_and_record_execution
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_and_record_execution(
Function launch_and_record_logs
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def launch_and_record_logs(
Function create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create(
Function launch_and_record_execution
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def launch_and_record_execution(
Function await_list_execution_status
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def await_list_execution_status(
stepfunctions_client, state_machine_arn: str, execution_arn: str, status: str
):
"""required as there is some eventual consistency in list_executions vs describe_execution and get_execution_history"""
- 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 _normalise_events
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _normalise_events(events: list[dict]) -> None:
start_idx = None
sublist = list()
in_sublist = False
for i, event in enumerate(events):
- 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 await_execution_lists_terminated
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def await_execution_lists_terminated(
stepfunctions_client, state_machine_arn: str, execution_arn: str
):
def _check_last_is_terminal() -> bool:
list_output = stepfunctions_client.list_executions(stateMachineArn=state_machine_arn)
- 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 await_on_execution_logs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def await_on_execution_logs(
aws_client,
log_group_name: str,
validation_function: Callable[[HistoryEventList], bool] = None,
) -> HistoryEventList:
- 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"