graphqler/fuzzer/fengine/fengine.py
Function __run_mutation
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Open
def __run_mutation(self, mutation_name: str, objects_bucket: ObjectsBucket, materializer: Materializer) -> tuple[dict, Result]:
"""Runs the mutation, and returns a new objects bucket. Performs a few things:
1. Materializes the mutation with its parameters (resolving any dependencies from the object_bucket)
2. Send the mutation against the server and gets the parses the object from the response
3. Process the result in the objects_bucket if it's an object with an ID
- 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 __run_query
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def __run_query(self, query_name: str, objects_bucket: ObjectsBucket, materializer: Materializer) -> tuple[dict, Result]:
"""Runs the query, and returns a new objects bucket
Args:
query_name (str): The name of the query
- 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
Open
return (graphql_response, Result.EXTERNAL_FAILURE)
Avoid too many return
statements within this function. Open
Open
return ({}, Result.INTERNAL_FAILURE)
Avoid too many return
statements within this function. Open
Open
return (graphql_response, Result.GENERAL_SUCCESS)
Avoid too many return
statements within this function. Open
Open
return ({}, Result.INTERNAL_FAILURE)
Avoid too many return
statements within this function. Open
Open
return (graphql_response, Result.HAS_DATA_SUCCESS)
Avoid too many return
statements within this function. Open
Open
return ({}, Result.INTERNAL_FAILURE)