martinandert/gql

View on GitHub

Showing 28 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

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

                racc_action_table = [
                    35,    31,    32,    33,    34,    35,     6,    28,    35,    31,
                    32,    33,    34,    51,    39,    28,    45,    29,    55,    35,
                    31,    32,    33,    34,     7,    29,    28,    37,    72,     6,
                    46,    38,    14,     6,    71,    12,    29,    35,    31,    32,
                Severity: Major
                Found in lib/gql/parser.rb and 1 other location - About 2 hrs to fix
                lib/gql/parser.rb on lines 83..92

                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 88.

                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

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

                racc_action_check = [
                    29,    29,    29,    29,    29,    28,     0,    29,    14,    14,
                    14,    14,    14,    28,    21,    14,    21,    29,    29,    22,
                    22,    22,    22,    22,     1,    14,    22,    18,    56,     3,
                    22,    18,     5,    22,    56,     6,    22,    67,    67,    67,
                Severity: Major
                Found in lib/gql/parser.rb and 1 other location - About 2 hrs to fix
                lib/gql/parser.rb on lines 72..81

                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 88.

                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

                  handleSubmit: function(e) {
                    var self = this;
                
                    $.post('/query', { q: this.state.query }, function(data) {
                      self.setState({ result: data });
                Severity: Major
                Found in example/lib/app/public/desktop.js and 1 other location - About 2 hrs to fix
                example/lib/app/public/mobile.js on lines 37..45

                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 79.

                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

                  handleSubmit: function(e) {
                    var self = this;
                
                    $.post('/query', { q: this.state.query }, function(data) {
                      self.setState({ result: data });
                Severity: Major
                Found in example/lib/app/public/mobile.js and 1 other location - About 2 hrs to fix
                example/lib/app/public/desktop.js on lines 299..307

                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 79.

                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

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

                racc_goto_table = [
                    24,    48,    49,    53,    15,     9,    41,     1,    20,    54,
                    18,    40,    44,     2,     8,    57,    21,    47,    58,    13,
                    23,    17,    52,    56,   nil,   nil,    61,   nil,   nil,   nil,
                   nil,   nil,    62,   nil,   nil,   nil,    20,    20,   nil,    60,
                Severity: Major
                Found in lib/gql/parser.rb and 1 other location - About 1 hr to fix
                lib/gql/parser.rb on lines 122..128

                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 61.

                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

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

                racc_goto_check = [
                    12,    10,    11,    22,     6,     4,    14,     1,     6,    23,
                     5,     8,     8,     2,     3,    12,     7,     9,    13,    16,
                    17,     2,    21,    24,   nil,   nil,    14,   nil,   nil,   nil,
                   nil,   nil,     8,   nil,   nil,   nil,     6,     6,   nil,     5,
                Severity: Major
                Found in lib/gql/parser.rb and 1 other location - About 1 hr to fix
                lib/gql/parser.rb on lines 114..120

                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 61.

                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

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

                        <select id="query-selector" ref="selector" onChange={this.handleSelected}>
                          <option value="">---</option>
                          {options}
                        </select>
                Severity: Major
                Found in example/lib/app/public/desktop.js and 1 other location - About 1 hr to fix
                example/lib/app/public/mobile.js on lines 23..26

                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 55.

                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

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

                          <select id="query-selector" ref="selector" onChange={this.handleQuerySelected}>
                            <option value="">[ Select Query ]</option>
                            {options}
                          </select>
                Severity: Major
                Found in example/lib/app/public/mobile.js and 1 other location - About 1 hr to fix
                example/lib/app/public/desktop.js on lines 245..248

                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 55.

                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 _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
                        Severity
                        Category
                        Status
                        Source
                        Language