irobayna/stupidedi

View on GitHub

Showing 171 of 292 total issues

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

      def initialize(separators, segment_dict, instructions, zipper, children)
Severity: Minor
Found in lib/stupidedi/parser/states/failure_state.rb - About 35 mins to fix

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

          def register(gs08, gs01, st01, definition = nil, &constructor)
    Severity: Minor
    Found in lib/stupidedi/config/transaction_set_config.rb - About 35 mins to fix

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

            def push(zipper, parent, segment_tok, segment_use, config)
      Severity: Minor
      Found in lib/stupidedi/parser/states/interchange_state.rb - About 35 mins to fix

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

              def initialize(segment_id, segment_use, pop, drop, push)
        Severity: Minor
        Found in lib/stupidedi/parser/instruction.rb - About 35 mins to fix

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

                def push(zipper, parent, segment_tok, segment_use, config)
          Severity: Minor
          Found in lib/stupidedi/parser/states/functional_group_state.rb - About 35 mins to fix

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

                  def initialize(separators, segment_dict, instructions, zipper, children)
            Severity: Minor
            Found in lib/stupidedi/parser/states/interchange_state.rb - About 35 mins to fix

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

                    def read_delimiter
                      position = 0
              
                      while @input.defined_at?(position)
                        character = @input.at(position)
              Severity: Minor
              Found in lib/stupidedi/reader/token_reader.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 pretty_print has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def pretty_print(q)
                      if @children.empty?
                        id = definition.try do |d|
                          ansi.bold("[#{d.id.to_s}: #{d.name.to_s}]")
                        end
              Severity: Minor
              Found in lib/stupidedi/values/repeated_element_val.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(object, usage, position)
                          if object.is_a?(StringVal)
                            object#.copy(:usage => usage, :position => position)
                          elsif object.blank?
                            self::Empty.new(usage, position)
              Severity: Minor
              Found in lib/stupidedi/versions/common/element_types/an.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 consume has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def consume(s)
                      return success(self) if s.empty?
              
                      position = 0
                      buffer   = " " * s.length
              Severity: Minor
              Found in lib/stupidedi/reader/token_reader.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 deconstruct has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                      def deconstruct(element_toks, m, n)
                        element_tok = element_toks.at(m)
                        element_tok = element_tok.element_toks.at(0) if element_tok.try(:repeated?)
              
                        if element_tok.blank?
              Severity: Minor
              Found in lib/stupidedi/parser/constraint_table.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 initialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                          def initialize(hour, minute, second, usage, position)
                            @hour, @minute, @second = hour, minute, second
              
                            valid   = (  hour.nil? or hour.between?(0, 24))
                            valid &&= (minute.nil? or not hour.nil?)
              Severity: Minor
              Found in lib/stupidedi/versions/common/element_types/tm.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 read_composite_element has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def read_composite_element(repeatable = false)
                      read_component_elements(repeatable).flatmap do |components, aR|
                        token = composite(components, @input, aR.input)
              
                        aR.read_delimiter.flatmap do |delim, bR|
              Severity: Minor
              Found in lib/stupidedi/reader/token_reader.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 process has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                def process
                  return unless owner.is_a?(Hash)
                  return unless statement.first
              
                  parse_block(statement.first, owner: owner.merge(source: statement.source))
              Severity: Minor
              Found in build/doc/lib/rspec-plugin/lib/yard-rspec/handler.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 consume_isa has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def consume_isa
                      position = 0
                      buffer   = "   "
              
                      # @todo: This would probably more optimal if it was written like
              Severity: Minor
              Found in lib/stupidedi/reader/stream_reader.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 build has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                    def build(instructions)
                      if instructions.length <= 1
                        ConstraintTable::Stub.new(instructions)
                      elsif instructions.any?{|i| i.segment_use.nil? } and
                        not instructions.all?{|i| i.segment_use.nil? }
              Severity: Minor
              Found in lib/stupidedi/parser/constraint_table.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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                        def initialize(id, name, min_length, max_length, description = nil, parent = nil)
                          super(id, name, min_length, max_length, description)
              
                          unless min_length == 2 or min_length == 4 or min_length >= 6
                            raise Exceptions::InvalidSchemaError,
              Severity: Minor
              Found in lib/stupidedi/versions/common/element_types/tm.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

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

                        def value(object, usage, position)
                          if object.is_a?(FixnumVal)
                            object#.copy(:usage => usage, :position => position)
                          elsif object.blank?
                            self::Empty.new(usage, position)
              Severity: Minor
              Found in lib/stupidedi/versions/common/element_types/nn.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

              Method mkelement has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                    def mkelement(designator, element_use, element_tok)
                      if element_use.simple?
                        if element_use.repeatable?
                          element_toks = element_tok.element_toks
                          element_vals = element_toks.map do |element_tok1|
              Severity: Minor
              Found in lib/stupidedi/parser/states/abstract_state.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

              Method process has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                def process
                  describes = statement.tokens.to_s[MATCH, 1].gsub(/["']/, '')
              
                  # Remove the argument list from describe "#method(a, b, &c)"
                  if arguments = describes[/[#.](?:.+?)(\([^)]*\))$/, 1]
              Severity: Minor
              Found in build/doc/lib/rspec-plugin/lib/yard-rspec/legacy.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