irobayna/stupidedi

View on GitHub
lib/stupidedi/parser/states/abstract_state.rb

Summary

Maintainability
C
1 day
Test Coverage

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

      def tsequence(table_defs, offset = 0)
        instructions = []
        buffer       = []
        last         = nil

Severity: Minor
Found in lib/stupidedi/parser/states/abstract_state.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 sequence has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

      def sequence(segment_uses, offset = 0)
        instructions = []
        buffer       = []
        last         = nil

Severity: Minor
Found in lib/stupidedi/parser/states/abstract_state.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 lsequence has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

      def lsequence(loop_defs, offset = 0)
        instructions = []
        buffer       = []
        last         = nil

Severity: Minor
Found in lib/stupidedi/parser/states/abstract_state.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 tsequence has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def tsequence(table_defs, offset = 0)
        instructions = []
        buffer       = []
        last         = nil

Severity: Minor
Found in lib/stupidedi/parser/states/abstract_state.rb - About 1 hr to fix

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

          def mksimple(designator, element_use, element_tok)
            # We don't validate that element_tok is simple because the TokenReader
            # will always produce a SimpleElementTok given a SimpleElementUse from
            # the SegmentDef. On the other hand, the BuilderDsl API will throw an
            # exception if the programmer constructs the wrong kind of element
    Severity: Minor
    Found in lib/stupidedi/parser/states/abstract_state.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 lsequence has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def lsequence(loop_defs, offset = 0)
            instructions = []
            buffer       = []
            last         = nil
    
    
    Severity: Minor
    Found in lib/stupidedi/parser/states/abstract_state.rb - About 1 hr to fix

      Method sequence has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def sequence(segment_uses, offset = 0)
              instructions = []
              buffer       = []
              last         = nil
      
      
      Severity: Minor
      Found in lib/stupidedi/parser/states/abstract_state.rb - About 1 hr to fix

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

              def mksegment(segment_tok, segment_use)
                segment_def  = segment_use.definition
                element_uses = segment_def.element_uses
                element_toks = segment_tok.element_toks
        
        
        Severity: Minor
        Found in lib/stupidedi/parser/states/abstract_state.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 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

        There are no issues that match your filters.

        Category
        Status