Showing 51 of 51 total issues
Function materialize_output_object_fields
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def materialize_output_object_fields(self,
Function parse_as_scalar
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def parse_as_scalar(self, method_name: str, method_data: dict | list | str | int | float | bool | None):
"""Parses the data as a scalar (can be a list, dict, or any of the base GraphQL types
Args:
method_name (str): The method name
- 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_mutation_action
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_mutation_action(self, mutation_name: str, mutation_description: str | None) -> str:
"""Gets the method action as a string by checking both the method name and method description
Args:
mutation_name (str): The mutation name
- 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_inputs_related_to_ids
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_inputs_related_to_ids(self, inputs: dict, input_objects: dict) -> dict:
"""Recursively finds any inputs that has ID in its name as that would imply it references other objects
Args:
inputs (dict): An inputs
- 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 materialize_input_fields
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def materialize_input_fields(self, operator_info: dict, inputs: dict, objects_bucket: ObjectsBucket, max_depth: int, current_depth: int = 0) -> str:
Function get_number_of_successful_mutations_and_queries
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_number_of_successful_mutations_and_queries(self) -> tuple[int, int]:
"""Returns the number of successful mutations and queries"""
number_success_of_mutations_and_queries = 0
num_mutations_and_queries = self.number_of_mutations + self.number_of_queries
for action, num_success in self.successful_nodes.items():
- 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 resolve
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def resolve(self, objects: dict, queries: dict, mutations: dict) -> dict:
"""Resolves the objects by attaching the correlated queries/mutations that output this object
Args:
objects (dict): The objects available
- 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 __fuzz
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __fuzz(self, node: Node, visit_path: list[Node]):
"""Fuzzes a node by running the node and storing the results. Currently runs:
- DOS Query / Mutation (from size 0 to MAX_INPUT_DEPTH or HARD_CUTOFF_DEPTH, whichever is smaller)
Args:
- 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
Avoid too many return
statements within this function. Open
return (graphql_response, Result.EXTERNAL_FAILURE)
Avoid too many return
statements within this function. Open
return self.get_random_date(input_name)
Avoid too many return
statements within this function. Open
return self.get_random_id(input_name, objects_bucket)
Avoid too many return
statements within this function. Open
return (gql_response, False)
Avoid too many return
statements within this function. Open
return "UNKNOWN"
Avoid too many return
statements within this function. Open
return ({}, Result.INTERNAL_FAILURE)
Avoid too many return
statements within this function. Open
return self.get_random_time(input_name)
Avoid too many return
statements within this function. Open
return self.get_random_datetime(input_name)
Avoid too many return
statements within this function. Open
return (gql_response, False)
Avoid too many return
statements within this function. Open
return (gql_response, True)
Avoid too many return
statements within this function. Open
return "UPDATE"
Avoid too many return
statements within this function. Open
return self.get_random_long(input_name)