archivesspace/archivesspace

View on GitHub
backend/app/converters/lib/marcxml_bib_base_map.rb

Summary

Maintainability
F
1 wk
Test Coverage

File marcxml_bib_base_map.rb has 1270 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module MarcXMLBibBaseMap

  AUTH_SUBJECT_SOURCE = {
    'a'=>"lcsh",
    'b'=>"LC subject headings for children's literature",
Severity: Major
Found in backend/app/converters/lib/marcxml_bib_base_map.rb - About 3 days to fix

    Method BASE_RECORD_MAP has 639 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def BASE_RECORD_MAP
        {
          :obj => :resource,
          :defaults => {
           :level => 'collection',
    Severity: Major
    Found in backend/app/converters/lib/marcxml_bib_base_map.rb - About 3 days to fix

      Method BASE_RECORD_MAP has a Cognitive Complexity of 132 (exceeds 5 allowed). Consider refactoring.
      Open

        def BASE_RECORD_MAP
          {
            :obj => :resource,
            :defaults => {
             :level => 'collection',
      Severity: Minor
      Found in backend/app/converters/lib/marcxml_bib_base_map.rb - About 2 days 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 subfield_template has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

        def subfield_template(template, node, map=nil)
          result = template.dup
          section = /\{([^@${]*)([@$])(ind[0-9]|\S{1})([^}]*)\}/
          while result.match(section)
            if $2 == '@'
      Severity: Minor
      Found in backend/app/converters/lib/marcxml_bib_base_map.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 sets_authority_properties has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

        def sets_authority_properties(primary = false, authorized = false, type = :name)
          -> auth, node {
            if record_properties[:type] == :authority
              authority_id = primary ? node.inner_text : nil
              auth['authority_id'] = authority_id
      Severity: Minor
      Found in backend/app/converters/lib/marcxml_bib_base_map.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 agent_template has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def agent_template
          {
            :rel => -> resource, agent {
              agent.publish = true
              resource[:linked_agents] << {
      Severity: Major
      Found in backend/app/converters/lib/marcxml_bib_base_map.rb - About 2 hrs to fix

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

          def concatenate_subfields(codearray, node, delim=' ', subfield_order = false)
            result = ""
            if subfield_order
              result = node.children.map do |subfield|
                codearray.include?(subfield[:code]) ? subfield.inner_text : ''
        Severity: Minor
        Found in backend/app/converters/lib/marcxml_bib_base_map.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 creators has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def creators
            {
              :map => {
                "subfield[@code='d']" => :dates,
                "subfield[@code='e']" => -> agent, node {
        Severity: Minor
        Found in backend/app/converters/lib/marcxml_bib_base_map.rb - About 1 hr to fix

          Method subfield_template has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def subfield_template(template, node, map=nil)
              result = template.dup
              section = /\{([^@${]*)([@$])(ind[0-9]|\S{1})([^}]*)\}/
              while result.match(section)
                if $2 == '@'
          Severity: Minor
          Found in backend/app/converters/lib/marcxml_bib_base_map.rb - About 1 hr to fix

            Method sources has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def sources
                {
                  :map => {
                    "subfield[@code='d']" => :dates,
                    "subfield[@code='e']" => -> agent, node {
            Severity: Minor
            Found in backend/app/converters/lib/marcxml_bib_base_map.rb - About 1 hr to fix

              Method corp_template has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def corp_template
                  mix(agent_template, {
                    :obj => :agent_corporate_entity,
                    :map => {
                      # NAMES (CORPORATE)
              Severity: Minor
              Found in backend/app/converters/lib/marcxml_bib_base_map.rb - About 1 hr to fix

                Method agent_template has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                  def agent_template
                    {
                      :rel => -> resource, agent {
                        agent.publish = true
                        resource[:linked_agents] << {
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.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 record_properties has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                  def record_properties(type_of_record = nil, source = nil, rules = nil)
                    @properties ||= { type: :bibliographic, source: nil , rules: nil}
                    if type_of_record
                      @properties[:type] = type_of_record == 'z' ? :authority : :bibliographic
                    end
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.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 sets_subject_source has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  def sets_subject_source
                    -> node {
                      if record_properties[:type] == :authority
                        AUTH_SUBJECT_SOURCE[ record_properties[:source] ] || 'Source not specified'
                      else
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.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 adds_prefixed_qualifier has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  def adds_prefixed_qualifier(prefix, separator = ': ')
                    -> name, node {
                      val = node.inner_text
                      if val
                        name.qualifier ||= ""
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb - About 35 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 multipart_note has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  def multipart_note(note_type, label = nil, template=nil, *tmpl_args)
                    {
                      :obj => :note_multipart,
                      :rel => :notes,
                      :map => {
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb - About 35 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 subject_template has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  def subject_template(getterms, getsrc, variant_tag = nil)
                    {
                      :obj => :subject,
                      :rel => :subjects,
                      :map => {
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.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

                Method dates_of_existence_date_for has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  def dates_of_existence_date_for(node, subfields)
                    date = nil
                    subfields.each do |sc|
                      date_node = node.at_xpath("subfield[@code='#{sc}']")
                      date      = date_node.inner_text.strip.gsub(/[^\d]/, '') if date_node
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.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

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

                      :map => {
                        "subfield[@code='d']" => :dates,
                        "subfield[@code='e']" => -> agent, node {
                          agent['_role'] = case
                                           when ['Auctioneer (auc)',
                Severity: Major
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb and 1 other location - About 1 hr to fix
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 359..386

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

                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

                      :map => {
                        "subfield[@code='d']" => :dates,
                        "subfield[@code='e']" => -> agent, node {
                          agent['_role'] = case
                                           when ['Auctioneer (auc)',
                Severity: Major
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb and 1 other location - About 1 hr to fix
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 318..345

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

                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

                                                                    -> node {
                                                                      terms = []
                                                                      node.xpath("subfield").each do |sf|
                                                                        terms << make_term(
                                                                                           {
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb and 1 other location - About 35 mins to fix
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 1378..1393

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

                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

                                                                                                  -> node {
                                                                                                    terms = []
                                                                                                    # FIXME: subfield `c` not handled
                                                                                                    node.xpath("subfield").each do |sf|
                                                                                                      terms << make_term(
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb and 1 other location - About 35 mins to fix
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 1397..1411

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

                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

                                                                    -> node {
                                                                      terms = []
                                                                      node.xpath("subfield").each do |sf|
                                                                        terms << make_term(
                                                                                           {
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb and 1 other location - About 30 mins to fix
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 1361..1374

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

                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

                  def family_template
                    mix(agent_template, {
                      :obj => :agent_family,
                      :map => {
                        # NAMES (FAMILY)
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb and 1 other location - About 30 mins to fix
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 188..204

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

                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

                  def person_template
                    mix(agent_template, {
                      :obj => :agent_person,
                      :map => {
                        # NAMES (PERSON)
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb and 1 other location - About 30 mins to fix
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 229..245

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

                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

                                                                                                -> node {
                                                                                                  terms = []
                                                                                                  node.xpath("subfield").each do |sf|
                                                                                                    terms << make_term(
                                                                                                                       {
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb and 1 other location - About 30 mins to fix
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 1417..1430

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

                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

                  def trim(property, trailing_char = ',', remove_chars = [])
                    -> name, node {
                      val = node.inner_text
                      remove_chars.each { |char| val = val.gsub(/#{Regexp.escape(char)}/, '') }
                      name[property] = val.chomp(trailing_char)
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb and 1 other location - About 30 mins to fix
                backend/app/converters/lib/marcxml_auth_agent_base_map.rb on lines 937..942

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

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

                        "datafield[@tag='099']" => -> resource, node {
                          id = concatenate_subfields(('a'..'z'), node, '_')
                
                          if resource.id_0.nil? or resource.id_0.empty?
                            resource.id_0 = id unless id.empty?
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb and 6 other locations - About 15 mins to fix
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 817..823
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 826..832
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 835..841
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 844..850
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 853..859
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 862..868

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

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

                        "datafield[@tag='096']" => -> resource, node {
                          id = concatenate_subfields(('a'..'z'), node, '_')
                
                          if resource.id_0.nil? or resource.id_0.empty?
                            resource.id_0 = id unless id.empty?
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb and 6 other locations - About 15 mins to fix
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 808..814
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 817..823
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 826..832
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 844..850
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 853..859
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 862..868

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

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

                        "datafield[@tag='098']" => -> resource, node {
                          id = concatenate_subfields(('a'..'z'), node, '_')
                
                          if resource.id_0.nil? or resource.id_0.empty?
                            resource.id_0 = id unless id.empty?
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb and 6 other locations - About 15 mins to fix
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 808..814
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 817..823
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 826..832
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 835..841
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 853..859
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 862..868

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

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

                        "datafield[@tag='090']" => -> resource, node {
                          id = concatenate_subfields(('a'..'z'), node, '_')
                
                          if resource.id_0.nil? or resource.id_0.empty?
                            resource.id_0 = id unless id.empty?
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb and 6 other locations - About 15 mins to fix
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 808..814
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 826..832
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 835..841
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 844..850
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 853..859
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 862..868

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

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

                        "datafield[@tag='082']" => -> resource, node {
                          id = concatenate_subfields(('a'..'z'), node, '_')
                
                          if resource.id_0.nil? or resource.id_0.empty?
                            resource.id_0 = id unless id.empty?
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb and 6 other locations - About 15 mins to fix
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 808..814
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 817..823
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 826..832
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 835..841
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 844..850
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 853..859

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

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

                        "datafield[@tag='092']" => -> resource, node {
                          id = concatenate_subfields(('a'..'z'), node, '_')
                
                          if resource.id_0.nil? or resource.id_0.empty?
                            resource.id_0 = id unless id.empty?
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb and 6 other locations - About 15 mins to fix
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 808..814
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 817..823
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 835..841
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 844..850
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 853..859
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 862..868

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

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

                        "datafield[@tag='050']" => -> resource, node {
                          id = concatenate_subfields(('a'..'z'), node, '_')
                
                          if resource.id_0.nil? or resource.id_0.empty?
                            resource.id_0 = id unless id.empty?
                Severity: Minor
                Found in backend/app/converters/lib/marcxml_bib_base_map.rb and 6 other locations - About 15 mins to fix
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 808..814
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 817..823
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 826..832
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 835..841
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 844..850
                backend/app/converters/lib/marcxml_bib_base_map.rb on lines 862..868

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

                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

                There are no issues that match your filters.

                Category
                Status