rmosolgo/graphql-ruby

View on GitHub

Showing 446 of 458 total issues

Method continue_value has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def continue_value(path, value, field, is_non_null, ast_node)
Severity: Minor
Found in lib/graphql/execution/interpreter/runtime.rb - About 35 mins to fix

    Method call has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def call(parent_type, parent_object, field_definition, field_args, query_context)
    Severity: Minor
    Found in lib/graphql/schema/timeout_middleware.rb - About 35 mins to fix

      Method evaluate_selections has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              def evaluate_selections(path, scoped_context, owner_object, owner_type, selections, root_operation_type: nil)
      Severity: Minor
      Found in lib/graphql/execution/interpreter/runtime.rb - About 35 mins to fix

        Method from_dsl has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def self.from_dsl(name, type_or_argument = nil, description = nil, default_value: NO_DEFAULT_VALUE, as: nil, prepare: DefaultPrepare, **kwargs, &block)
        Severity: Minor
        Found in lib/graphql/argument.rb - About 35 mins to fix

          Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  def initialize(context, key, irep_node, parent, object)
          Severity: Minor
          Found in lib/graphql/query/context.rb - About 35 mins to fix

            Method call has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                  def self.call(parent_type, parent_object, field_definition, field_args, query_context)
            Severity: Minor
            Found in lib/graphql/schema/catchall_middleware.rb - About 35 mins to fix

              Method on_timeout has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                    def on_timeout(parent_type, parent_object, field_definition, field_args, field_context)
              Severity: Minor
              Found in lib/graphql/schema/timeout_middleware.rb - About 35 mins to fix

                Method follow_spreads has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                      def follow_spreads(node, parent_variables, spreads_for_context, fragment_definitions, visited_fragments)
                Severity: Minor
                Found in lib/graphql/static_validation/rules/variables_are_used_and_defined.rb - About 35 mins to fix

                  Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def initialize(value, field, parent_type, resolved_type, possible_types)
                  Severity: Minor
                  Found in lib/graphql/unresolved_type_error.rb - About 35 mins to fix

                    Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                          def initialize(name, value, line, col, prev_token)
                    Severity: Minor
                    Found in lib/graphql/language/token.rb - About 35 mins to fix

                      Method validate_fragment_in_scope has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                            def validate_fragment_in_scope(parent_type, child_type, node, context, path)
                      Severity: Minor
                      Found in lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb - About 35 mins to fix

                        Method create_error has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                              def create_error(error_message, var_type, ast_var, arg_defn, arg_node)
                        Severity: Minor
                        Found in lib/graphql/static_validation/rules/variable_usages_are_allowed.rb - About 35 mins to fix

                          Identical blocks of code found in 2 locations. Consider refactoring.
                          Open

                              var channelId = Math.round(Date.now() + Math.random() * 100000).toString(16)
                          Severity: Minor
                          Found in javascript_client/src/subscriptions/ActionCableSubscriber.ts and 1 other location - About 35 mins to fix
                          javascript_client/src/subscriptions/createActionCableHandler.ts on lines 18..18

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 47.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Identical blocks of code found in 2 locations. Consider refactoring.
                          Open

                              var channelId = Math.round(Date.now() + Math.random() * 100000).toString(16)
                          Severity: Minor
                          Found in javascript_client/src/subscriptions/createActionCableHandler.ts and 1 other location - About 35 mins to fix
                          javascript_client/src/subscriptions/ActionCableSubscriber.ts on lines 32..32

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 47.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Method resolve_type has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  def resolve_type(types, type)
                                    case kind = type.fetch("kind")
                                    when "ENUM", "INTERFACE", "INPUT_OBJECT", "OBJECT", "SCALAR", "UNION"
                                      type_name = type.fetch("name")
                                      type = types[type_name] || Schema::BUILT_IN_TYPES[type_name]
                          Severity: Minor
                          Found in lib/graphql/schema/loader.rb - 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

                          Method assert_property_list_of has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  def self.assert_property_list_of(property_name, list_member_class)
                                    ->(obj) {
                                      property_value = obj.public_send(property_name)
                                      if !property_value.is_a?(Array)
                                        "#{property_name} must be an Array of #{list_member_class.name}, not a #{property_value.class.name} (#{property_value.inspect})"
                          Severity: Minor
                          Found in lib/graphql/schema/validation.rb - 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

                          Method value has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                                def value
                                  if !@resolved
                                    @resolved = true
                                    @value = begin
                                      v = @get_value_func.call
                          Severity: Minor
                          Found in lib/graphql/execution/lazy.rb - 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

                          Method resolve has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  def self.resolve(results)
                                    next_results = []
                          
                                    # Work through the queue until it's empty
                                    while results.size > 0
                          Severity: Minor
                          Found in lib/graphql/execution/interpreter/resolve.rb - 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

                          Method connection? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                                def connection?
                                  if @connection.nil?
                                    # Provide default based on type name
                                    return_type_name = if (contains_type = @field || @function)
                                      Member::BuildType.to_type_name(contains_type.type)
                          Severity: Minor
                          Found in lib/graphql/schema/field.rb - 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

                          Method before_query has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  def before_query(query)
                                    # Get the root type for this query
                                    root_node = query.irep_selection
                                    if root_node.nil?
                                      # It's an invalid query, nothing to do here
                          Severity: Minor
                          Found in lib/graphql/schema/member/instrumentation.rb - 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

                          Severity
                          Category
                          Status
                          Source
                          Language