File provider.py
has 816 lines of code (exceeds 250 allowed). Consider refactoring. Open
import copy
import datetime
import json
import logging
import re
StepFunctionsProvider
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class StepFunctionsProvider(StepfunctionsApi, ServiceLifecycleHook):
_TEST_STATE_MAX_TIMEOUT_SECONDS: Final[int] = 300 # 5 minutes.
@staticmethod
def get_store(context: RequestContext) -> SFNStore:
Function update_state_machine
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_state_machine(
Function update_state_machine
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update_state_machine(
self,
context: RequestContext,
state_machine_arn: Arn,
definition: Definition = 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 list_executions
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def list_executions(
Function test_state
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def test_state(
Function create_state_machine
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def create_state_machine(
self, context: RequestContext, request: CreateStateMachineInput, **kwargs
) -> CreateStateMachineOutput:
if not request.get("publish", False) and request.get("versionDescription"):
raise ValidationException("Version description can only be set when publish is true")
- 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 send_task_failure
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def send_task_failure(
self,
context: RequestContext,
task_token: TaskToken,
error: SensitiveError = 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 send_task_heartbeat
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def send_task_heartbeat(
self, context: RequestContext, task_token: TaskToken, **kwargs
) -> SendTaskHeartbeatOutput:
running_executions: list[Execution] = self._get_executions(context, ExecutionStatus.RUNNING)
for execution in running_executions:
- 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 send_task_success
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def send_task_success(
self, context: RequestContext, task_token: TaskToken, output: SensitiveData, **kwargs
) -> SendTaskSuccessOutput:
outcome = CallbackOutcomeSuccess(callback_id=task_token, output=output)
running_executions: list[Execution] = self._get_executions(context, ExecutionStatus.RUNNING)
- 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_map_run
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_map_run(
Function get_execution_history
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_execution_history(
Function start_execution
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def start_execution(
Function start_execution
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def start_execution(
self,
context: RequestContext,
state_machine_arn: Arn,
name: Name = 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 list_map_runs
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def list_map_runs(
Function list_state_machine_versions
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def list_state_machine_versions(
Function publish_state_machine_version
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def publish_state_machine_version(
Function tag_resource
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def tag_resource(
Function get_activity_task
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_activity_task(
Function send_task_failure
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_task_failure(
Function stop_execution
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def stop_execution(
Function list_activities
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def list_activities(
Function untag_resource
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def untag_resource(
Function create_activity
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_activity(