archivesspace/archivesspace

View on GitHub
backend/app/exporters/serializers/ead3.rb

Summary

Maintainability
F
3 wks
Test Coverage

File ead3.rb has 1212 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require_relative 'ead'
class EAD3Serializer < EADSerializer
  serializer_for :ead3

  def valid_children_of_p
Severity: Major
Found in backend/app/exporters/serializers/ead3.rb - About 3 days to fix

    Method serialize_control has a Cognitive Complexity of 143 (exceeds 5 allowed). Consider refactoring.
    Open

      def serialize_control(data, xml, fragments)
        control_atts = {
          repositoryencoding: "iso15511",
          countryencoding: "iso3166-1",
          dateencoding: "iso8601",
    Severity: Minor
    Found in backend/app/exporters/serializers/ead3.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 serialize_dates has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
    Open

      def serialize_dates(obj, xml, fragments)
        add_unitdate = Proc.new do |value, context, fragments, atts={}|
          context.unitdate(atts) {
            sanitize_mixed_content( value, context, fragments )
          }
    Severity: Minor
    Found in backend/app/exporters/serializers/ead3.rb - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method convert_ead2002_markup has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
    Open

      def convert_ead2002_markup(content)
        apply_changes = lambda do |fn, fragment|
          fragment.element_children.each do |e|
            fn.(e)
            if !e.element_children.empty?
    Severity: Minor
    Found in backend/app/exporters/serializers/ead3.rb - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method serialize_control has 222 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def serialize_control(data, xml, fragments)
        control_atts = {
          repositoryencoding: "iso15511",
          countryencoding: "iso3166-1",
          dateencoding: "iso8601",
    Severity: Major
    Found in backend/app/exporters/serializers/ead3.rb - About 1 day to fix

      Method serialize_subnotes has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
      Open

        def serialize_subnotes(subnotes, xml, fragments, include_p = true)
          subnotes.each do |sn|
            next if sn["publish"] === false && !@include_unpublished
      
            audatt = sn["publish"] === false ? {:audience => 'internal'} : {}
      Severity: Minor
      Found in backend/app/exporters/serializers/ead3.rb - About 7 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 serialize_digital_object_dao has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

        def serialize_digital_object_dao(digital_object, xml, fragments)
          return if digital_object["publish"] === false && !@include_unpublished
          return if digital_object["suppressed"] === true
      
          file_versions = digital_object['file_versions']
      Severity: Minor
      Found in backend/app/exporters/serializers/ead3.rb - About 5 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Class EAD3Serializer has 42 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class EAD3Serializer < EADSerializer
        serializer_for :ead3
      
        def valid_children_of_p
          ['abbr', 'corpname', 'date', 'emph', 'expan', 'famname', 'footnote', 'foreign', 'function', 'genreform',
      Severity: Minor
      Found in backend/app/exporters/serializers/ead3.rb - About 5 hrs to fix

        Method serialize_indexes has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
        Open

          def serialize_indexes(data, xml, fragments)
            data.indexes.each do |note|
              next if note["publish"] === false && !@include_unpublished
              content = ASpaceExport::Utils.extract_note_text(note, @include_unpublished)
              head_text = nil
        Severity: Minor
        Found in backend/app/exporters/serializers/ead3.rb - About 5 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method serialize_extents has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

          def serialize_extents(obj, xml, fragments)
            if obj.extents.length
              obj.extents.each do |e|
                next if e["publish"] === false && !@include_unpublished
        
        
        Severity: Minor
        Found in backend/app/exporters/serializers/ead3.rb - About 4 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method convert_ead2002_markup has 110 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def convert_ead2002_markup(content)
            apply_changes = lambda do |fn, fragment|
              fragment.element_children.each do |e|
                fn.(e)
                if !e.element_children.empty?
        Severity: Major
        Found in backend/app/exporters/serializers/ead3.rb - About 4 hrs to fix

          Method stream has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

            def stream(data)
              @stream_handler = ASpaceExport::StreamHandler.new
              @fragments = ASpaceExport::RawXMLHandler.new
              @include_unpublished = data.include_unpublished?
              @include_daos = data.include_daos?
          Severity: Minor
          Found in backend/app/exporters/serializers/ead3.rb - About 4 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

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

            def stream(data)
              @stream_handler = ASpaceExport::StreamHandler.new
              @fragments = ASpaceExport::RawXMLHandler.new
              @include_unpublished = data.include_unpublished?
              @include_daos = data.include_daos?
          Severity: Major
          Found in backend/app/exporters/serializers/ead3.rb - About 3 hrs to fix

            Method structure_children has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

              def structure_children(content, parent_name = nil)
                # 4archon...
                content.gsub!("\n\t", "\n\n")
            
                content.strip!
            Severity: Minor
            Found in backend/app/exporters/serializers/ead3.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 serialize_child has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

              def serialize_child(data, xml, fragments, c_depth = 1)
                begin
                  return if data["publish"] === false && !@include_unpublished
                  return if data["suppressed"] === true
            
            
            Severity: Minor
            Found in backend/app/exporters/serializers/ead3.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 serialize_did_notes has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

              def serialize_did_notes(data, xml, fragments)
                data.notes.each do |note|
                  next if note["publish"] === false && !@include_unpublished
                  # SEE backend/app/exporters/lib/export_helpers.rb - did note types valid for both EAD 2002 and EAD3
                  next unless data.did_note_types.include?(note['type'])
            Severity: Minor
            Found in backend/app/exporters/serializers/ead3.rb - About 2 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Method serialize_bibliographies has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

              def serialize_bibliographies(data, xml, fragments)
                data.bibliographies.each do |note|
                  next if note["publish"] === false && !@include_unpublished
                  content = ASpaceExport::Utils.extract_note_text(note, @include_unpublished)
                  note_type = note["type"] ? note["type"] : "bibliography"
            Severity: Minor
            Found in backend/app/exporters/serializers/ead3.rb - About 2 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Method serialize_controlaccess has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

              def serialize_controlaccess(data, xml, fragments)
                if (data.controlaccess_subjects.length + data.controlaccess_linked_agents(@include_unpublished).reject {|x| x.empty?}.length) > 0
                  xml.controlaccess {
            
                    data.controlaccess_subjects.zip(data.subjects).each do |node_data, subject|
            Severity: Minor
            Found in backend/app/exporters/serializers/ead3.rb - About 2 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Method serialize_child has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def serialize_child(data, xml, fragments, c_depth = 1)
                begin
                  return if data["publish"] === false && !@include_unpublished
                  return if data["suppressed"] === true
            
            
            Severity: Major
            Found in backend/app/exporters/serializers/ead3.rb - About 2 hrs to fix

              Method structure_children has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def structure_children(content, parent_name = nil)
                  # 4archon...
                  content.gsub!("\n\t", "\n\n")
              
                  content.strip!
              Severity: Minor
              Found in backend/app/exporters/serializers/ead3.rb - About 2 hrs to fix

                Method serialize_digital_object_dao has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def serialize_digital_object_dao(digital_object, xml, fragments)
                    return if digital_object["publish"] === false && !@include_unpublished
                    return if digital_object["suppressed"] === true
                
                    file_versions = digital_object['file_versions']
                Severity: Minor
                Found in backend/app/exporters/serializers/ead3.rb - About 1 hr to fix

                  Method serialize_dates has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def serialize_dates(obj, xml, fragments)
                      add_unitdate = Proc.new do |value, context, fragments, atts={}|
                        context.unitdate(atts) {
                          sanitize_mixed_content( value, context, fragments )
                        }
                  Severity: Minor
                  Found in backend/app/exporters/serializers/ead3.rb - About 1 hr to fix

                    Method serialize_subnotes has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def serialize_subnotes(subnotes, xml, fragments, include_p = true)
                        subnotes.each do |sn|
                          next if sn["publish"] === false && !@include_unpublished
                    
                          audatt = sn["publish"] === false ? {:audience => 'internal'} : {}
                    Severity: Minor
                    Found in backend/app/exporters/serializers/ead3.rb - About 1 hr to fix

                      Method serialize_extents has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def serialize_extents(obj, xml, fragments)
                          if obj.extents.length
                            obj.extents.each do |e|
                              next if e["publish"] === false && !@include_unpublished
                      
                      
                      Severity: Minor
                      Found in backend/app/exporters/serializers/ead3.rb - About 1 hr to fix

                        Method serialize_note_content has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def serialize_note_content(note, xml, fragments)
                            return if note["publish"] === false && !@include_unpublished
                            content = note["content"]
                        
                            atts = {
                        Severity: Minor
                        Found in backend/app/exporters/serializers/ead3.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 serialize_nondid_notes has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def serialize_nondid_notes(data, xml, fragments)
                            data.notes.each do |note|
                              next if note["publish"] === false && !@include_unpublished
                              next if note['internal']
                              next if note['type'].nil?
                        Severity: Minor
                        Found in backend/app/exporters/serializers/ead3.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 serialize_indexes has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def serialize_indexes(data, xml, fragments)
                            data.indexes.each do |note|
                              next if note["publish"] === false && !@include_unpublished
                              content = ASpaceExport::Utils.extract_note_text(note, @include_unpublished)
                              head_text = nil
                        Severity: Minor
                        Found in backend/app/exporters/serializers/ead3.rb - About 1 hr to fix

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

                            def serialize_did_notes(data, xml, fragments)
                              data.notes.each do |note|
                                next if note["publish"] === false && !@include_unpublished
                                # SEE backend/app/exporters/lib/export_helpers.rb - did note types valid for both EAD 2002 and EAD3
                                next unless data.did_note_types.include?(note['type'])
                          Severity: Minor
                          Found in backend/app/exporters/serializers/ead3.rb - About 1 hr to fix

                            Method serialize_controlaccess has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def serialize_controlaccess(data, xml, fragments)
                                if (data.controlaccess_subjects.length + data.controlaccess_linked_agents(@include_unpublished).reject {|x| x.empty?}.length) > 0
                                  xml.controlaccess {
                            
                                    data.controlaccess_subjects.zip(data.subjects).each do |node_data, subject|
                            Severity: Minor
                            Found in backend/app/exporters/serializers/ead3.rb - About 1 hr to fix

                              Method serialize_container has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def serialize_container(inst, xml, fragments)
                                  atts = {}
                              
                                  sub = inst['sub_container']
                                  top = sub['top_container']['_resolved']
                              Severity: Minor
                              Found in backend/app/exporters/serializers/ead3.rb - About 1 hr to fix

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

                                  def serialize_languages(languages, xml, fragments)
                                    language_vals = languages.map {|l| l['language_and_script']}.compact
                                    # Language and Script subrecords with recorded values in both fields should be exported as <languageset> elements.
                                    xml.langmaterial {
                                      language_vals.map {|language|
                                Severity: Minor
                                Found in backend/app/exporters/serializers/ead3.rb - About 1 hr to fix

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

                                    def serialize_origination(data, xml, fragments)
                                      unless data.creators_and_sources.nil?
                                        data.creators_and_sources.each do |link|
                                          agent = link['_resolved']
                                          link['role'] == 'creator' ? role = link['role'].capitalize : role = link['role']
                                  Severity: Minor
                                  Found in backend/app/exporters/serializers/ead3.rb - About 1 hr to fix

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

                                      def serialize_origination(data, xml, fragments)
                                        unless data.creators_and_sources.nil?
                                          data.creators_and_sources.each do |link|
                                            agent = link['_resolved']
                                            link['role'] == 'creator' ? role = link['role'].capitalize : role = link['role']
                                    Severity: Minor
                                    Found in backend/app/exporters/serializers/ead3.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 serialize_container has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      def serialize_container(inst, xml, fragments)
                                        atts = {}
                                    
                                        sub = inst['sub_container']
                                        top = sub['top_container']['_resolved']
                                    Severity: Minor
                                    Found in backend/app/exporters/serializers/ead3.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 strip_invalid_children_from_note_content has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      def strip_invalid_children_from_note_content(content, parent_element_name)
                                        # convert & to @@ before generating XML fragment for processing
                                        content.gsub!(/&/, '@@')
                                        fragment = Nokogiri::XML::DocumentFragment.parse(content)
                                        children = fragment.element_children
                                    Severity: Minor
                                    Found in backend/app/exporters/serializers/ead3.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

                                    Consider simplifying this complex logical expression.
                                    Open

                                        if file_versions.empty?
                                          atts['href'] = digital_object['digital_object_id']
                                          atts['actuate'] = 'onrequest'
                                          atts['show'] = 'new'
                                          atts['audience'] = 'internal' unless is_digital_object_published?(digital_object)
                                    Severity: Major
                                    Found in backend/app/exporters/serializers/ead3.rb - About 40 mins to fix

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

                                        def serialize_languages(languages, xml, fragments)
                                          language_vals = languages.map {|l| l['language_and_script']}.compact
                                          # Language and Script subrecords with recorded values in both fields should be exported as <languageset> elements.
                                          xml.langmaterial {
                                            language_vals.map {|language|
                                      Severity: Minor
                                      Found in backend/app/exporters/serializers/ead3.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

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

                                            when 'note_chronology'
                                              xml.chronlist(audatt) {
                                                xml.head { sanitize_mixed_content(title, xml, fragments) } if title
                                      
                                                sn['items'].each do |item|
                                      Severity: Major
                                      Found in backend/app/exporters/serializers/ead3.rb and 1 other location - About 1 hr to fix
                                      backend/app/exporters/serializers/ead.rb on lines 443..458

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

                                      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 handle_arks(data, xml)
                                          return unless AppConfig[:arks_enabled]
                                          return unless data.ark_name
                                      
                                          if current_ark = data.ark_name.fetch('current', nil)
                                      Severity: Major
                                      Found in backend/app/exporters/serializers/ead3.rb and 1 other location - About 1 hr to fix
                                      backend/app/exporters/serializers/ead.rb on lines 256..280

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

                                      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

                                            when 'note_definedlist'
                                              xml.list({:listtype => 'deflist'}.merge(audatt)) {
                                                xml.head { sanitize_mixed_content(title, xml, fragments) } if title
                                      
                                                sn['items'].each do |item|
                                      Severity: Major
                                      Found in backend/app/exporters/serializers/ead3.rb and 1 other location - About 1 hr to fix
                                      backend/app/exporters/serializers/ead.rb on lines 471..478

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

                                      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

                                          xml.send(note['type'], atts) {
                                            xml.head { sanitize_mixed_content(head_text, xml, fragments) } unless ASpaceExport::Utils.headless_note?(note['type'], content )
                                            sanitize_mixed_content(content, xml, fragments, ASpaceExport::Utils.include_p?(note['type']) ) if content
                                            if note['subnotes']
                                              serialize_subnotes(note['subnotes'], xml, fragments, ASpaceExport::Utils.include_p?(note['type']))
                                      Severity: Major
                                      Found in backend/app/exporters/serializers/ead3.rb and 1 other location - About 1 hr to fix
                                      backend/app/exporters/serializers/ead.rb on lines 749..753

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

                                      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

                                          (2..3).each do |n|
                                            atts = {}
                                      
                                            next unless sub["type_#{n}"]
                                      
                                      
                                      Severity: Major
                                      Found in backend/app/exporters/serializers/ead3.rb and 1 other location - About 1 hr to fix
                                      backend/app/exporters/serializers/ead.rb on lines 511..524

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

                                      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

                                                xml.send(node_data[:node_name], node_data[:atts]) {
                                                  xml.part() {
                                                    sanitize_mixed_content( node_data[:content], xml, fragments, ASpaceExport::Utils.include_p?(node_data[:node_name]) )
                                                    EAD3Serializer.run_serialize_step(agent['_resolved'], xml, fragments, node_data[:node_name].to_sym)
                                      Severity: Minor
                                      Found in backend/app/exporters/serializers/ead3.rb and 1 other location - About 35 mins to fix
                                      backend/app/exporters/serializers/ead3.rb on lines 1276..1279

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

                                      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

                                                xml.send(node_data[:node_name], node_data[:atts]) {
                                                  xml.part() {
                                                    sanitize_mixed_content( node_data[:content], xml, fragments, ASpaceExport::Utils.include_p?(node_data[:node_name]) )
                                                    EAD3Serializer.run_serialize_step(subject['_resolved'], xml, fragments, node_data[:node_name].to_sym)
                                      Severity: Minor
                                      Found in backend/app/exporters/serializers/ead3.rb and 1 other location - About 35 mins to fix
                                      backend/app/exporters/serializers/ead3.rb on lines 1298..1301

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

                                      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

                                          if date['expression']
                                            content << date['expression']
                                          elsif date['begin']
                                            content << date['begin']
                                            if date['end'] != date['begin']
                                      Severity: Minor
                                      Found in backend/app/exporters/serializers/ead3.rb and 1 other location - About 35 mins to fix
                                      backend/app/exporters/serializers/ead.rb on lines 553..560

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

                                      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

                                            xml.bibliography(atts) {
                                              xml.head { sanitize_mixed_content(head_text, xml, fragments) }
                                              sanitize_mixed_content( content, xml, fragments, true)
                                              note['items'].each do |item|
                                                xml.bibref { sanitize_mixed_content( item, xml, fragments) } unless item.empty?
                                      Severity: Minor
                                      Found in backend/app/exporters/serializers/ead3.rb and 1 other location - About 30 mins to fix
                                      backend/app/exporters/serializers/ead.rb on lines 787..791

                                      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 extract_head_text(content, backup = "")
                                          content ||= ""
                                          match = content.strip.match(/<head( [^<>]+)?>(.+?)<\/head>/)
                                          if match.nil? # content has no head so we return it as it
                                            return [content, backup ]
                                      Severity: Minor
                                      Found in backend/app/exporters/serializers/ead3.rb and 1 other location - About 25 mins to fix
                                      backend/app/exporters/serializers/ead.rb on lines 288..294

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

                                      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

                                              xml.list(atts) {
                                                xml.head { sanitize_mixed_content(title, xml, fragments) } if title
                                      
                                                sn['items'].each do |item|
                                                  xml.item { sanitize_mixed_content(item, xml, fragments)}
                                      Severity: Minor
                                      Found in backend/app/exporters/serializers/ead3.rb and 1 other location - About 20 mins to fix
                                      backend/app/exporters/serializers/ead.rb on lines 464..468

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

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

                                                    if @include_unpublished
                                                      data.external_ids.each do |exid|
                                                        xml.unitid ({ "audience" => "internal", "type" => exid['source'], "identifier" => exid['external_id']}) { xml.text exid['external_id']}
                                      Severity: Minor
                                      Found in backend/app/exporters/serializers/ead3.rb and 3 other locations - About 15 mins to fix
                                      backend/app/exporters/serializers/ead.rb on lines 188..190
                                      backend/app/exporters/serializers/ead.rb on lines 326..328
                                      backend/app/exporters/serializers/ead3.rb on lines 1182..1184

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

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

                                                if @include_unpublished
                                                  data.external_ids.each do |exid|
                                                    xml.unitid ({ "audience" => "internal", "type" => exid['source'], "identifier" => exid['external_id']}) { xml.text exid['external_id']}
                                      Severity: Minor
                                      Found in backend/app/exporters/serializers/ead3.rb and 3 other locations - About 15 mins to fix
                                      backend/app/exporters/serializers/ead.rb on lines 188..190
                                      backend/app/exporters/serializers/ead.rb on lines 326..328
                                      backend/app/exporters/serializers/ead3.rb on lines 517..519

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

                                      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

                                            if note['label']
                                              head_text = note['label']
                                            elsif note['type']
                                              head_text = I18n.t("enumerations._note_types.#{note['type']}", :default => note['type'])
                                            end
                                      Severity: Minor
                                      Found in backend/app/exporters/serializers/ead3.rb and 1 other location - About 15 mins to fix
                                      backend/app/exporters/serializers/ead.rb on lines 804..808

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

                                        def prefix_id(id)
                                          if id.nil? or id.empty? or id == 'null'
                                            ""
                                          elsif id =~ /^#{@id_prefix}/
                                            id
                                      Severity: Minor
                                      Found in backend/app/exporters/serializers/ead3.rb and 1 other location - About 15 mins to fix
                                      backend/app/exporters/serializers/ead.rb on lines 24..31

                                      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