irobayna/stupidedi

View on GitHub

Showing 292 of 292 total issues

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

      def read_elements(segment_id, element_uses)
        if element_uses.empty?
          read_simple_element
        else
          element_use = element_uses.head
Severity: Minor
Found in lib/stupidedi/reader/token_reader.rb - About 1 hr to fix

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

            def build_distinct(total, n, m, instructions)
              if total.finite?
                # The sum of all allowed value sets is finite, so we know that each
                # individual allowed value set is finite (we can iterate over it).
                map = Hash.new{|h,k| h[k] = [] }
    Severity: Minor
    Found in lib/stupidedi/parser/constraint_table.rb - About 1 hr to fix

      Method pretty_print has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def pretty_print(q)
              id = definition.bind do |d|
                "[#{d.id}: #{d.name}]".bind do |s|
                  if usage.forbidden?
                    ansi.forbidden(s)
      Severity: Minor
      Found in lib/stupidedi/values/composite_element_val.rb - About 1 hr to fix

        Method build_disjoint has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def build_disjoint(total, n, m, instructions)
                  if total.finite?
                    # The sum of all allowed value sets is finite, so we know that each
                    # individual allowed value set is finite (we can iterate over it).
                    map = Hash.new
        Severity: Minor
        Found in lib/stupidedi/parser/constraint_table.rb - About 1 hr to fix

          Method process has 26 lines of code (exceeds 25 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/handler.rb - About 1 hr to fix

            Method push has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def push(zipper, parent, segment_tok, segment_use, config)
                    case segment_use.parent
                    when Schema::TableDef
                      table_def   = segment_use.parent
                      table_val   = table_def.empty
            Severity: Minor
            Found in lib/stupidedi/parser/states/table_state.rb - About 1 hr to fix

              Similar blocks of code found in 6 locations. Consider refactoring.
              Open

                module Versions
                  module ThirtyTen
                    s = Schema
                    r = ElementReqs
              
              
              Severity: Major
              Found in lib/stupidedi/versions/003010/functional_group_def.rb and 5 other locations - About 1 hr to fix
              lib/stupidedi/versions/002001/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/003040/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/003050/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/004010/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/005010/functional_group_def.rb on lines 3..20

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 47.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 6 locations. Consider refactoring.
              Open

                module Versions
                  module FiftyTen
                    s = Schema
                    r = ElementReqs
              
              
              Severity: Major
              Found in lib/stupidedi/versions/005010/functional_group_def.rb and 5 other locations - About 1 hr to fix
              lib/stupidedi/versions/002001/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/003010/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/003040/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/003050/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/004010/functional_group_def.rb on lines 3..20

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 47.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 6 locations. Consider refactoring.
              Open

                module Versions
                  module FortyTen
                    s = Schema
                    r = ElementReqs
              
              
              Severity: Major
              Found in lib/stupidedi/versions/004010/functional_group_def.rb and 5 other locations - About 1 hr to fix
              lib/stupidedi/versions/002001/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/003010/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/003040/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/003050/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/005010/functional_group_def.rb on lines 3..20

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 47.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 6 locations. Consider refactoring.
              Open

                module Versions
                  module TwoThousandOne
                    s = Schema
                    r = ElementReqs
              
              
              Severity: Major
              Found in lib/stupidedi/versions/002001/functional_group_def.rb and 5 other locations - About 1 hr to fix
              lib/stupidedi/versions/003010/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/003040/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/003050/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/004010/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/005010/functional_group_def.rb on lines 3..20

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 47.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 6 locations. Consider refactoring.
              Open

                module Versions
                  module ThirtyForty
                    s = Schema
                    r = ElementReqs
              
              
              Severity: Major
              Found in lib/stupidedi/versions/003040/functional_group_def.rb and 5 other locations - About 1 hr to fix
              lib/stupidedi/versions/002001/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/003010/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/003050/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/004010/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/005010/functional_group_def.rb on lines 3..20

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 47.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 6 locations. Consider refactoring.
              Open

                module Versions
                  module ThirtyFifty
                    s = Schema
                    r = ElementReqs
              
              
              Severity: Major
              Found in lib/stupidedi/versions/003050/functional_group_def.rb and 5 other locations - About 1 hr to fix
              lib/stupidedi/versions/002001/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/003010/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/003040/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/004010/functional_group_def.rb on lines 3..20
              lib/stupidedi/versions/005010/functional_group_def.rb on lines 3..20

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 47.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

                    def first
                      active = roots.map do |zipper|
                        state = zipper
                        value = zipper.node.zipper
              
              
              Severity: Minor
              Found in lib/stupidedi/parser/navigation.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 process has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                def process
                  return unless statement.last.last
              
                  describes = statement.parameters.first.jump(:string_content).source
              
              
              Severity: Minor
              Found in build/doc/lib/rspec-plugin/lib/yard-rspec/handler.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 process has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                def process
                  methods = statement.parameters.slice(0..-3).map{|x| x.source }
                  target  = statement.parameters.jump(:assoc)
              
                  unless target.eql?(statement.parameters)
              Severity: Minor
              Found in build/doc/lib/meta-plugin/lib/yard-meta/handler.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 last has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                    def last
                      active = roots.map do |zipper|
                        state = zipper
                        value = zipper.node.zipper
              
              
              Severity: Minor
              Found in lib/stupidedi/parser/navigation.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 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 to_time has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                          def to_time(hour = nil, minute = nil, second = nil)
                            if minute.nil? and second.nil? and hour.respond_to?(:hour)
                              if hour.respond_to?(:minute) and hour.respond_to?(:second)
                                hour, minute, second = hour.hour, hour.minute, hour.second
                              elsif hour.respond_to?(:min) and hour.respond_to?(:sec)
              Severity: Minor
              Found in lib/stupidedi/versions/common/element_types/dt.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 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

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                  methods.each do |name|
                    name = name.slice(1..-1)
              
                    object = register(YARD::CodeObjects::MethodObject.new(namespace, name, scope)) do |o|
                      o.visibility = visibility
              Severity: Minor
              Found in build/doc/lib/meta-plugin/lib/yard-meta/legacy.rb and 1 other location - About 55 mins to fix
              build/doc/lib/meta-plugin/lib/yard-meta/handler.rb on lines 96..106

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 45.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language