gabynaiman/nql

View on GitHub

Showing 28 of 38 total issues

Method _nt_comparator has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring.
Open

    def _nt_comparator
      start_index = index
      if node_cache[:comparator].has_key?(index)
        cached = node_cache[:comparator][index]
        if cached
Severity: Minor
Found in lib/nql/grammar.rb - About 2 days 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

File grammar.rb has 757 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module NQL
  module Syntax
    include Treetop::Runtime

    def root
Severity: Major
Found in lib/nql/grammar.rb - About 1 day to fix

    Method _nt_primary has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
    Open

        def _nt_primary
          start_index = index
          if node_cache[:primary].has_key?(index)
            cached = node_cache[:primary][index]
            if cached
    Severity: Minor
    Found in lib/nql/grammar.rb - About 1 day 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 _nt_text has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
    Open

        def _nt_text
          start_index = index
          if node_cache[:text].has_key?(index)
            cached = node_cache[:text][index]
            if cached
    Severity: Minor
    Found in lib/nql/grammar.rb - About 1 day 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 _nt_comparator has 128 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def _nt_comparator
          start_index = index
          if node_cache[:comparator].has_key?(index)
            cached = node_cache[:comparator][index]
            if cached
    Severity: Major
    Found in lib/nql/grammar.rb - About 5 hrs to fix

      Method _nt_primary has 123 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def _nt_primary
            start_index = index
            if node_cache[:primary].has_key?(index)
              cached = node_cache[:primary][index]
              if cached
      Severity: Major
      Found in lib/nql/grammar.rb - About 4 hrs to fix

        Method _nt_text has 109 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def _nt_text
              start_index = index
              if node_cache[:text].has_key?(index)
                cached = node_cache[:text][index]
                if cached
        Severity: Major
        Found in lib/nql/grammar.rb - About 4 hrs to fix

          Method _nt_boolean has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              def _nt_boolean
                start_index = index
                if node_cache[:boolean].has_key?(index)
                  cached = node_cache[:boolean][index]
                  if cached
          Severity: Minor
          Found in lib/nql/grammar.rb - 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

          Method _nt_comparison has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              def _nt_comparison
                start_index = index
                if node_cache[:comparison].has_key?(index)
                  cached = node_cache[:comparison][index]
                  if cached
          Severity: Minor
          Found in lib/nql/grammar.rb - 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

          Method _nt_coordinator has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              def _nt_coordinator
                start_index = index
                if node_cache[:coordinator].has_key?(index)
                  cached = node_cache[:coordinator][index]
                  if cached
          Severity: Minor
          Found in lib/nql/grammar.rb - 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

          Method _nt_alphanumeric has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              def _nt_alphanumeric
                start_index = index
                if node_cache[:alphanumeric].has_key?(index)
                  cached = node_cache[:alphanumeric][index]
                  if cached
          Severity: Minor
          Found in lib/nql/grammar.rb - 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

          Method _nt_space has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              def _nt_space
                start_index = index
                if node_cache[:space].has_key?(index)
                  cached = node_cache[:space][index]
                  if cached
          Severity: Minor
          Found in lib/nql/grammar.rb - 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

          Method _nt_boolean has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def _nt_boolean
                start_index = index
                if node_cache[:boolean].has_key?(index)
                  cached = node_cache[:boolean][index]
                  if cached
          Severity: Minor
          Found in lib/nql/grammar.rb - About 1 hr to fix

            Method _nt_coordinator has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def _nt_coordinator
                  start_index = index
                  if node_cache[:coordinator].has_key?(index)
                    cached = node_cache[:coordinator][index]
                    if cached
            Severity: Minor
            Found in lib/nql/grammar.rb - About 1 hr to fix

              Method _nt_comparison has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def _nt_comparison
                    start_index = index
                    if node_cache[:comparison].has_key?(index)
                      cached = node_cache[:comparison][index]
                      if cached
              Severity: Minor
              Found in lib/nql/grammar.rb - About 1 hr to fix

                Method invalid_attributes has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    def invalid_attributes(node, valid_attributes)
                      return [] unless node
                
                      node.deep_symbolize_keys.flat_map do |k, v|
                        if k == :a
                Severity: Minor
                Found in lib/nql/query.rb - 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

                Method _nt_expression has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _nt_expression
                      start_index = index
                      if node_cache[:expression].has_key?(index)
                        cached = node_cache[:expression][index]
                        if cached
                Severity: Minor
                Found in lib/nql/grammar.rb - 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

                Method _nt_alphanumeric has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def _nt_alphanumeric
                      start_index = index
                      if node_cache[:alphanumeric].has_key?(index)
                        cached = node_cache[:alphanumeric][index]
                        if cached
                Severity: Minor
                Found in lib/nql/grammar.rb - About 1 hr to fix

                  Method _nt_space has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def _nt_space
                        start_index = index
                        if node_cache[:space].has_key?(index)
                          cached = node_cache[:space][index]
                          if cached
                  Severity: Minor
                  Found in lib/nql/grammar.rb - About 1 hr to fix

                    Avoid deeply nested control flow statements.
                    Open

                                    if has_terminal?('<', false, index)
                                      r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
                                      @index += 1
                                    else
                                      terminal_parse_failure('<')
                    Severity: Major
                    Found in lib/nql/grammar.rb - About 45 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language