omar2535/GraphQLer

View on GitHub

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,
Severity: Minor
Found in graphqler/fuzzer/fengine/materializers/materializer.py - About 45 mins to fix

    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
    Severity: Minor
    Found in graphqler/utils/objects_bucket.py - About 45 mins 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 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
    Severity: Minor
    Found in graphqler/compiler/resolvers/mutation_object_resolver.py - About 45 mins 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 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
    Severity: Minor
    Found in graphqler/compiler/resolvers/resolver.py - About 45 mins 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 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:
    Severity: Minor
    Found in graphqler/fuzzer/fengine/materializers/materializer.py - About 35 mins to fix

      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():
      Severity: Minor
      Found in graphqler/utils/stats.py - About 35 mins 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 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
      Severity: Minor
      Found in graphqler/compiler/resolvers/object_method_resolver.py - About 35 mins 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 __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:
      Severity: Minor
      Found in graphqler/fuzzer/fuzzer.py - About 35 mins 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 self.get_random_date(input_name)
        Severity: Major
        Found in graphqler/fuzzer/fengine/materializers/getter.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return self.get_random_id(input_name, objects_bucket)
          Severity: Major
          Found in graphqler/fuzzer/fengine/materializers/getter.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return (gql_response, False)
            Severity: Major
            Found in graphqler/fuzzer/fengine/retrier/retrier.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return "UNKNOWN"
              Severity: Major
              Found in graphqler/compiler/resolvers/mutation_object_resolver.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 self.get_random_time(input_name)
                  Severity: Major
                  Found in graphqler/fuzzer/fengine/materializers/getter.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return self.get_random_datetime(input_name)
                    Severity: Major
                    Found in graphqler/fuzzer/fengine/materializers/getter.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                          return (gql_response, False)
                      Severity: Major
                      Found in graphqler/fuzzer/fengine/retrier/retrier.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                        return (gql_response, True)
                        Severity: Major
                        Found in graphqler/fuzzer/fengine/retrier/retrier.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                          return "UPDATE"
                          Severity: Major
                          Found in graphqler/compiler/resolvers/mutation_object_resolver.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                            return self.get_random_long(input_name)
                            Severity: Major
                            Found in graphqler/fuzzer/fengine/materializers/getter.py - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language