irobayna/stupidedi

View on GitHub

Showing 171 of 292 total issues

Method read_component_element has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

      def read_component_element(repeatable = false)
        position = 0
        buffer   = ""

        while @input.defined_at?(position)
Severity: Minor
Found in lib/stupidedi/reader/token_reader.rb - About 55 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 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

          def initialize(id, name, min_length, max_length, precision, description = nil, parent = nil)
Severity: Major
Found in lib/stupidedi/versions/common/element_types/nn.rb - About 50 mins to fix

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

              def initialize(id, name, min_length, max_length, code_list = nil, description = nil, parent = nil)
    Severity: Major
    Found in lib/stupidedi/versions/common/element_types/id.rb - About 50 mins to fix

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

                def initialize(id, name, min_length, max_length, max_precision = nil, description = nil, parent = nil)
      Severity: Major
      Found in lib/stupidedi/versions/common/element_types/r.rb - About 50 mins to fix

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

              def initialize(separators, segment_dict, instructions, zipper, children, gs01, gs08)
        Severity: Major
        Found in lib/stupidedi/parser/states/functional_group_state.rb - About 50 mins to fix

          Avoid deeply nested control flow statements.
          Open

                        unless o <= components
                          raise ArgumentError,
                            "repeatable composite element #{descriptor} only has #{components} components"
                        end
          Severity: Major
          Found in lib/stupidedi/parser/navigation.rb - About 45 mins to fix

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

                      def initialize(id, name, min_length, max_length, description = nil, parent = nil)
            Severity: Minor
            Found in lib/stupidedi/versions/common/element_types/dt.rb - About 45 mins to fix

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

                    def initialize(id, name, description, component_uses, syntax_notes, parent)
              Severity: Minor
              Found in lib/stupidedi/schema/composite_element_def.rb - About 45 mins to fix

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

                      def read_segment
                        consume_isa.flatmap do |rest|
                          # The character after "ISA" is defined to be the element separator
                          rest.read_character.flatmap do |char, aR|
                            separators = Separators.new(nil, nil, char, nil)
                Severity: Minor
                Found in lib/stupidedi/reader/stream_reader.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 initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                          def initialize(id, name, min_length, max_length, description = nil, parent = nil)
                Severity: Minor
                Found in lib/stupidedi/versions/common/element_types/tm.rb - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      unless __value.eql?(__state.node.zipper)
                                        __state = __state.replace(__state.node.copy(:zipper => __value))
                                      end
                  Severity: Major
                  Found in lib/stupidedi/parser/navigation.rb - About 45 mins to fix

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

                      def process
                        return unless owner.is_a?(Hash)
                        return unless owner[:describes]
                    
                        node = YARD::Registry.resolve(nil, owner[:describes], true)
                    Severity: Minor
                    Found in build/doc/lib/rspec-plugin/lib/yard-rspec/legacy.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 initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                          def initialize(id, name, purpose, element_uses, syntax_notes, parent)
                    Severity: Minor
                    Found in lib/stupidedi/schema/segment_def.rb - About 45 mins to fix

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

                                def initialize(id, name, min_length, max_length, description = nil, parent = nil)
                      Severity: Minor
                      Found in lib/stupidedi/versions/common/element_types/simple_element.rb - About 45 mins to fix

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

                              def initialize(id, position, header_segment_uses, loop_defs, trailer_segment_uses, parent)
                        Severity: Minor
                        Found in lib/stupidedi/schema/table_def.rb - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                        if element_zip.node.blank?
                                          Either.failure("repeatable composite element #{descriptor} does not occur")
                                        elsif occurs_count < n
                                          Either.failure("repeatable composite element #{descriptor} only occurs #{occurs_count} times")
                                        else
                          Severity: Major
                          Found in lib/stupidedi/parser/navigation.rb - About 45 mins to fix

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

                              def process
                                return unless owner.is_a?(Hash)
                                return unless owner[:describes]
                            
                                node = YARD::Registry.resolve(nil, owner[:describes], true)
                            Severity: Minor
                            Found in build/doc/lib/rspec-plugin/lib/yard-rspec/legacy.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 segment has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                      def segment(pos, type, name, requirement, repeat, &block)
                            Severity: Minor
                            Found in lib/stupidedi/transaction_sets/builder/dsl.rb - About 45 mins to fix

                              Method Segment has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                    def Segment(position, segment_def, name, requirement, repeat_count, *elements)
                              Severity: Minor
                              Found in lib/stupidedi/transaction_sets/builder.rb - About 45 mins to fix

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

                                      def initialize(id, repeat_count, header_segment_uses, loop_defs, trailer_segment_uses, parent)
                                Severity: Minor
                                Found in lib/stupidedi/schema/loop_def.rb - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language