irobayna/stupidedi

View on GitHub

Showing 292 of 292 total issues

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

b.machine.parent.flatmap(&:parent).flatmap(&:parent).flatmap(&:zipper).tap do |z|
  separators =
    Stupidedi::Reader::Separators.build(:segment => "~\n",
                                        :element => "*",
                                        :component => ":",
Severity: Minor
Found in notes/generator.rb and 1 other location - About 55 mins to fix
notes/generator.rb on lines 40..49

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

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

b.machine.parent.flatmap(&:parent).flatmap(&:parent).flatmap(&:zipper).tap do |z|
  separators =
    Stupidedi::Reader::Separators.build(:segment => "~\n",
                                        :element => "*",
                                        :component => ":",
Severity: Minor
Found in notes/generator.rb and 1 other location - About 55 mins to fix
notes/generator.rb on lines 95..104

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

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/handler.rb and 1 other location - About 55 mins to fix
build/doc/lib/meta-plugin/lib/yard-meta/legacy.rb on lines 77..87

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

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

      def detail(id, *children)
        unless id.is_a?(String)
          raise Exceptions::InvalidSchemaError,
            "first argument to TableDef.detail must be a String but got #{id.inspect}"
        end
Severity: Major
Found in lib/stupidedi/schema/table_def.rb and 2 other locations - About 55 mins to fix
lib/stupidedi/schema/table_def.rb on lines 145..153
lib/stupidedi/schema/table_def.rb on lines 169..177

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 44.

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 3 locations. Consider refactoring.
Open

      def summary(id, *children)
        unless id.is_a?(String)
          raise Exceptions::InvalidSchemaError,
            "first argument to TableDef.summary must be a String but got #{id.inspect}"
        end
Severity: Major
Found in lib/stupidedi/schema/table_def.rb and 2 other locations - About 55 mins to fix
lib/stupidedi/schema/table_def.rb on lines 145..153
lib/stupidedi/schema/table_def.rb on lines 157..165

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 44.

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 3 locations. Consider refactoring.
Open

      def header(id, *children)
        unless id.is_a?(String)
          raise Exceptions::InvalidSchemaError,
            "first argument to TableDef.header must be a String but got #{id.inspect}"
        end
Severity: Major
Found in lib/stupidedi/schema/table_def.rb and 2 other locations - About 55 mins to fix
lib/stupidedi/schema/table_def.rb on lines 157..165
lib/stupidedi/schema/table_def.rb on lines 169..177

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 44.

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 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

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

                          case designators.length
                          when 0
                          when 1
                            raise Exceptions::InvalidSchemaError,
                              "proceeding from #{pp_machine(machine)}, the element
          Severity: Minor
          Found in lib/stupidedi/transaction_sets/validation/ambiguity.rb and 1 other location - About 50 mins to fix
          lib/stupidedi/transaction_sets/validation/ambiguity.rb on lines 122..134

          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 43.

          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 2 locations. Consider refactoring.
          Open

                          case designators.length
                          when 0
                          when 1
                            raise Exceptions::InvalidSchemaError,
                              "proceeding from #{pp_machine(machine)}, the element
          Severity: Minor
          Found in lib/stupidedi/transaction_sets/validation/ambiguity.rb and 1 other location - About 50 mins to fix
          lib/stupidedi/transaction_sets/validation/ambiguity.rb on lines 166..179

          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 43.

          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 5 locations. Consider refactoring.
          Open

                      {:AK1=>
                        [{:E479=>{:name=>"Functional Identifier Code", :value=>{:raw=>"HC", :description=>"Health Care Claim"}, :type=>:simple}},
                         {:E28=>{:name=>"Group Control Number", :value=>{:raw=>"17456", :description=>nil}, :type=>:simple}},
                         {:E480=>{:name=>"Version, Release, or Industry Identifier Code", :value=>{:raw=>"004010X098A1", :description=>nil}, :type=>:simple}}]},
          Severity: Major
          Found in notes/json_writer/sample_output.rb and 4 other locations - About 50 mins to fix
          notes/json_writer/sample_output.rb on lines 31..34
          notes/json_writer/sample_output.rb on lines 40..43
          notes/json_writer/sample_output.rb on lines 52..55
          notes/json_writer/sample_output.rb on lines 83..86

          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 42.

          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 5 locations. Consider refactoring.
          Open

                     [{:ST=>
                        [{:E143=>{:name=>"Transaction Set Identifier Code", :value=>{:raw=>"999", :description=>"Implementation Acknowledgement"}, :type=>:simple}},
                         {:E329=>{:name=>"Transaction Set Control Number", :value=>{:raw=>"2870001", :description=>nil}, :type=>:simple}},
                         {:E1705=>{:name=>"Implementation Guide Version Name", :value=>{:raw=>"005010X231", :description=>nil}, :type=>:simple}}]},
          Severity: Major
          Found in notes/json_writer/sample_output.rb and 4 other locations - About 50 mins to fix
          notes/json_writer/sample_output.rb on lines 35..38
          notes/json_writer/sample_output.rb on lines 40..43
          notes/json_writer/sample_output.rb on lines 52..55
          notes/json_writer/sample_output.rb on lines 83..86

          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 42.

          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 5 locations. Consider refactoring.
          Open

                        [{:AK2=>
                           [{:E143=>{:name=>"Transaction Set Identifier Code", :value=>{:raw=>"837", :description=>"Health Care Claim"}, :type=>:simple}},
                            {:E329=>{:name=>"Transaction Set Control Number", :value=>{:raw=>"0001", :description=>nil}, :type=>:simple}},
                            {:E1705=>{:name=>"Implementation Convention Reference", :value=>{:raw=>"", :description=>nil}, :type=>:simple}}]},
          Severity: Major
          Found in notes/json_writer/sample_output.rb and 4 other locations - About 50 mins to fix
          notes/json_writer/sample_output.rb on lines 31..34
          notes/json_writer/sample_output.rb on lines 35..38
          notes/json_writer/sample_output.rb on lines 52..55
          notes/json_writer/sample_output.rb on lines 83..86

          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 42.

          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 5 locations. Consider refactoring.
          Open

                        [{:AK2=>
                           [{:E143=>{:name=>"Transaction Set Identifier Code", :value=>{:raw=>"837", :description=>"Health Care Claim"}, :type=>:simple}},
                            {:E329=>{:name=>"Transaction Set Control Number", :value=>{:raw=>"0003", :description=>nil}, :type=>:simple}},
                            {:E1705=>{:name=>"Implementation Convention Reference", :value=>{:raw=>"", :description=>nil}, :type=>:simple}}]},
          Severity: Major
          Found in notes/json_writer/sample_output.rb and 4 other locations - About 50 mins to fix
          notes/json_writer/sample_output.rb on lines 31..34
          notes/json_writer/sample_output.rb on lines 35..38
          notes/json_writer/sample_output.rb on lines 40..43
          notes/json_writer/sample_output.rb on lines 52..55

          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 42.

          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 5 locations. Consider refactoring.
          Open

                        [{:AK2=>
                           [{:E143=>{:name=>"Transaction Set Identifier Code", :value=>{:raw=>"837", :description=>"Health Care Claim"}, :type=>:simple}},
                            {:E329=>{:name=>"Transaction Set Control Number", :value=>{:raw=>"0002", :description=>nil}, :type=>:simple}},
                            {:E1705=>{:name=>"Implementation Convention Reference", :value=>{:raw=>"", :description=>nil}, :type=>:simple}}]},
          Severity: Major
          Found in notes/json_writer/sample_output.rb and 4 other locations - About 50 mins to fix
          notes/json_writer/sample_output.rb on lines 31..34
          notes/json_writer/sample_output.rb on lines 35..38
          notes/json_writer/sample_output.rb on lines 40..43
          notes/json_writer/sample_output.rb on lines 83..86

          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 42.

          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

          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
                Severity
                Category
                Status
                Source
                Language