omar2535/GraphQLer

View on GitHub
graphqler/fuzzer/fengine/fengine.py

Summary

Maintainability
C
7 hrs
Test Coverage

Function __run_mutation has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
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
Severity: Minor
Found in graphqler/fuzzer/fengine/fengine.py - About 2 hrs to fix

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

    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
Severity: Minor
Found in graphqler/fuzzer/fengine/fengine.py - About 1 hr to fix

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)
Severity: Major
Found in graphqler/fuzzer/fengine/fengine.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return ({}, Result.INTERNAL_FAILURE)
    Severity: Major
    Found in graphqler/fuzzer/fengine/fengine.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return (graphql_response, Result.GENERAL_SUCCESS)
      Severity: Major
      Found in graphqler/fuzzer/fengine/fengine.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return ({}, Result.INTERNAL_FAILURE)
        Severity: Major
        Found in graphqler/fuzzer/fengine/fengine.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return (graphql_response, Result.HAS_DATA_SUCCESS)
          Severity: Major
          Found in graphqler/fuzzer/fengine/fengine.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return ({}, Result.INTERNAL_FAILURE)
            Severity: Major
            Found in graphqler/fuzzer/fengine/fengine.py - About 30 mins to fix

              There are no issues that match your filters.

              Category
              Status