martinandert/gql

View on GitHub

Showing 14 of 28 total issues

Method queries has 270 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def queries
      [{
        name: 'Details on the first 10 songs',
        value: <<-QUERY.strip_heredoc
          {
Severity: Major
Found in example/lib/app/helper.rb - About 1 day to fix

    File parser.rb has 499 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'racc/parser.rb'
    
    require 'active_support/json'
    require 'active_support/core_ext/object/blank'
    require 'active_support/core_ext/object/try'
    Severity: Minor
    Found in lib/gql/parser.rb - About 1 day to fix

      File helper.rb has 326 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'active_record'
      require 'gql'
      
      module App
        module Helper
      Severity: Minor
      Found in example/lib/app/helper.rb - About 3 hrs to fix

        Function GraphQLHighlightRules has 93 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          var GraphQLHighlightRules = function() {
            this.$rules = {
              "start": [
                {
                  token: "comment.block",
        Severity: Major
        Found in example/lib/app/public/desktop.js - About 3 hrs to fix

          File desktop.js has 276 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          define('ace/mode/graphql', function(require, exports, module) {
            var oop = require("ace/lib/oop");
            var TextMode = require("ace/mode/text").Mode;
            var Tokenizer = require("ace/tokenizer").Tokenizer;
            var GraphQLHighlightRules = require("ace/mode/graphql_highlight_rules").GraphQLHighlightRules;
          Severity: Minor
          Found in example/lib/app/public/desktop.js - About 2 hrs to fix

            Method change has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def change
                create_table :people do |t|
                  t.string  :slug,        :null => false
                  t.string  :first_name,  :null => false
                  t.string  :last_name,   :null => false
            Severity: Major
            Found in example/db/migrate/20150310163512_create_app.rb - About 2 hrs to fix

              Method _next_token has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def _next_token
                  text = @ss.peek(1)
                  @lineno  +=  1  if text == "\n"
                  token = case @state
                  when nil
              Severity: Major
              Found in lib/gql/tokenizer.rb - About 2 hrs to fix

                Method _next_token has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  def _next_token
                    text = @ss.peek(1)
                    @lineno  +=  1  if text == "\n"
                    token = case @state
                    when nil
                Severity: Minor
                Found in lib/gql/tokenizer.rb - 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

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

                      def execute(parent, ast_node, target, variables, context)
                Severity: Minor
                Found in lib/gql/field.rb - About 35 mins to fix

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

                        def execute(person_id_or_slug, band_id_or_slug, started_year, ended_year = nil, role_ids_or_slugs = [])
                  Severity: Minor
                  Found in example/lib/app/graph/create_band_membership_call.rb - About 35 mins to fix

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

                          def execute(caller_class, ast_node, target, variables, context)
                    Severity: Minor
                    Found in lib/gql/call.rb - About 35 mins to fix

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

                                def execute(caller_class, ast_node, target, variables, context)
                      Severity: Minor
                      Found in lib/gql/mixins/has_calls.rb - About 35 mins to fix

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

                            def tokenize(input)
                              tokenizer = Tokenizer.new
                              tokenizer.scan_setup input
                        
                              [].tap do |result|
                        Severity: Minor
                        Found in lib/gql.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 shutdown has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def shutdown(type, id)
                                const_name = send("const_name_for_#{type}", id)
                                accessor   = type.to_s.pluralize
                        
                                [self, *descendants].each do |c|
                        Severity: Minor
                        Found in lib/gql/mixins/common.rb - About 25 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