irobayna/stupidedi

View on GitHub

Showing 171 of 292 total issues

Method __find has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring.
Open

      def __find(invalid, id, elements, assert_repeatable = false)
        reachable   = false
        repeatable  = false
        matches     = []
        filter_tok  = nil
Severity: Minor
Found in lib/stupidedi/parser/navigation.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 element has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
Open

      def element(m, n = nil, o = nil)
        if m <= 0 or (n || 1) <= 0 or (o || 1) <= 0
          raise ArgumentError,
            "all arguments must be positive"
        end
Severity: Minor
Found in lib/stupidedi/parser/navigation.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 critique has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

      def critique(zipper, recursive = false, position = false)
        if zipper.node.simple? or zipper.node.component?
          if zipper.node.invalid?
            raise Exceptions::ParseError,
              "invalid #{zipper.node.descriptor} at #{zipper.node.position.inspect}"
Severity: Minor
Found in lib/stupidedi/parser/builder_dsl.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

File navigation.rb has 449 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Stupidedi
  using Refinements

  module Parser
    module Navigation
Severity: Minor
Found in lib/stupidedi/parser/navigation.rb - About 6 hrs to fix

    Method matches has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

            def matches(segment_tok, strict, mode)
              invalid = true  # Were all present possibly distinguishing elements invalid?
              present = false # Were any possibly distinguishing elements present?
    
              disjoint, distinct = basis(@instructions, mode)
    Severity: Minor
    Found in lib/stupidedi/parser/constraint_table.rb - About 6 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 value has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
    Open

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

    File dt.rb has 382 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Stupidedi
      using Refinements
    
      module Versions
        module Common
    Severity: Minor
    Found in lib/stupidedi/versions/common/element_types/dt.rb - About 5 hrs to fix

      Method mksegment_tok has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

            def mksegment_tok(segment_dict, id, elements, position)
              id = id.to_sym
              element_toks = []
      
              unless segment_dict.defined_at?(id)
      Severity: Minor
      Found in lib/stupidedi/parser/tokenization.rb - About 4 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 Segment has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

            def Segment(position, segment_def, name, requirement, repeat_count, *elements)
              unless elements.length == segment_def.element_uses.length
                raise Exceptions::InvalidSchemaError,
                  "segment #{segment_def.id} has #{segment_def.element_uses.length}" +
                  " elements but #{elements.length} arguments were given"
      Severity: Minor
      Found in lib/stupidedi/transaction_sets/builder.rb - About 3 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

      File token_reader.rb has 327 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module Stupidedi
        using Refinements
      
        module Reader
          class TokenReader
      Severity: Minor
      Found in lib/stupidedi/reader/token_reader.rb - About 3 hrs to fix

        Method build has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
        Open

              def build(node, out)
                if node.element?
                  if node.composite?
                    tmp = StringIO.new
                    node.children.each{|e| build(e, tmp) }
        Severity: Minor
        Found in lib/stupidedi/writer/claredi.rb - About 3 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 step has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
        Open

                def step(machine)
                  machine.successors.head.constraints.each do |segment_id, table|
                    case table
                    when Stupidedi::Parser::ConstraintTable::Shallowest,
                         Stupidedi::Parser::ConstraintTable::Deepest
        Severity: Minor
        Found in lib/stupidedi/transaction_sets/validation/ambiguity.rb - About 3 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 step has 89 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def step(machine)
                  machine.successors.head.constraints.each do |segment_id, table|
                    case table
                    when Stupidedi::Parser::ConstraintTable::Shallowest,
                         Stupidedi::Parser::ConstraintTable::Deepest
        Severity: Major
        Found in lib/stupidedi/transaction_sets/validation/ambiguity.rb - About 3 hrs to fix

          Method critique has 88 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def critique(zipper, recursive = false, position = false)
                  if zipper.node.simple? or zipper.node.component?
                    if zipper.node.invalid?
                      raise Exceptions::ParseError,
                        "invalid #{zipper.node.descriptor} at #{zipper.node.position.inspect}"
          Severity: Major
          Found in lib/stupidedi/parser/builder_dsl.rb - About 3 hrs to fix

            Class TokenReader has 29 methods (exceeds 20 allowed). Consider refactoring.
            Open

                class TokenReader
                  # @private
                  SEGMENT_ID = /\A[A-Z][A-Z0-9]{1,2}\Z/
            
                  include Inspect
            Severity: Minor
            Found in lib/stupidedi/reader/token_reader.rb - About 3 hrs to fix

              Method __find has 86 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def __find(invalid, id, elements, assert_repeatable = false)
                      reachable   = false
                      repeatable  = false
                      matches     = []
                      filter_tok  = nil
              Severity: Major
              Found in lib/stupidedi/parser/navigation.rb - About 3 hrs to fix

                Method element has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      def element(m, n = nil, o = nil)
                        if m <= 0 or (n || 1) <= 0 or (o || 1) <= 0
                          raise ArgumentError,
                            "all arguments must be positive"
                        end
                Severity: Major
                Found in lib/stupidedi/parser/navigation.rb - About 3 hrs to fix

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

                            def value(object, usage, position)
                              if object.is_a?(DateVal)
                                object#.copy(:usage => usage, :position => position)
                              elsif object.blank?
                                self::Empty.new(usage, position)
                  Severity: Minor
                  Found in lib/stupidedi/versions/common/element_types/dt.rb - About 3 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 process has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def process
                      name = statement.parameters.first.jump(:symbol, :ident).source.slice(1..-1)
                      args = statement.parameters.jump(:assoc)
                      params = []
                  
                  
                  Severity: Minor
                  Found in build/doc/lib/meta-plugin/lib/yard-meta/handler.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 recurse has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def recurse(value, separators, out)
                          return if value.invalid?
                  
                          if value.segment?
                            segment(value, separators, out)
                  Severity: Minor
                  Found in lib/stupidedi/writer/default.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

                  Severity
                  Category
                  Status
                  Source
                  Language