archivesspace/archivesspace

View on GitHub

Showing 2,432 of 2,432 total issues

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

  def large_tree_for_resource(largetree_opts = {})
    resource = Resource.get_or_die(params[:id])

    large_tree = LargeTree.new(resource, {:published_only => params[:published_only]}.merge(largetree_opts))
    large_tree.add_decorator(LargeTreeResource.new)
Severity: Minor
Found in backend/app/controllers/resource.rb and 2 other locations - About 15 mins to fix
backend/app/controllers/classification.rb on lines 153..159
backend/app/controllers/digital_object.rb on lines 167..173

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

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

  Endpoint.post('/repositories/:repo_id/top_containers/batch/container_profile')
    .description("Update container profile for a batch of top containers")
    .params(["ids", [Integer]],
            ["container_profile_uri", String, "The uri of the container profile"],
            ["repo_id", :repo_id])
Severity: Minor
Found in backend/app/controllers/container.rb and 1 other location - About 15 mins to fix
backend/app/controllers/container.rb on lines 89..96

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

Sequel.migration do

  up do
    now = Time.now
    [:accession, :archival_object, :resource].each do |table|
Severity: Minor
Found in common/db/migrations/092_reindex_anything_with_instances.rb and 1 other location - About 15 mins to fix
common/db/migrations/087_reindex_anything_with_instances.rb on lines 3..13

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

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

        if append
          html << '<label class="append-control">'
          html << form.merge_checkbox('append')
          html << '<small>'
          html << I18n.t("actions.merge_add").to_s
Severity: Minor
Found in frontend/app/helpers/aspace_form_helper.rb and 1 other location - About 15 mins to fix
frontend/app/helpers/aspace_form_helper.rb on lines 882..888

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

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

Sequel.migration do

  up do
    [:agent_person, :agent_software, :agent_corporate_entity,
     :agent_family, :subject].each do |table|
Severity: Minor
Found in common/db/migrations/009_reindex_agents_and_subjects.rb and 1 other location - About 15 mins to fix
common/db/migrations/008_reindex_agents_and_subjects.rb on lines 3..13

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

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

    [ "processing_hours_per_foot_estimate", "processing_total_extent", "processing_hours_total" ].each do |k|
      if !hash[k].nil? and hash[k] !~ /^\-?\d{0,9}(\.\d{1,5})?$/
        errors << [k, "must be a number with no more than nine digits and five decimal places"]
      end
Severity: Minor
Found in common/validations.rb and 3 other locations - About 15 mins to fix
common/validations.rb on lines 569..572
common/validations.rb on lines 575..578
common/validations.rb on lines 745..748

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

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

  Endpoint.delete('/repositories/:repo_id/assessments/:id')
    .description("Delete an Assessment")
    .params(["id", :id],
            ["repo_id", :repo_id])
    .permissions([:delete_assessment_record])
Severity: Major
Found in backend/app/controllers/assessment.rb and 10 other locations - About 15 mins to fix
backend/app/controllers/accession.rb on lines 68..75
backend/app/controllers/classification.rb on lines 55..62
backend/app/controllers/classification_term.rb on lines 87..94
backend/app/controllers/container.rb on lines 78..85
backend/app/controllers/digital_object.rb on lines 53..60
backend/app/controllers/digital_object_component.rb on lines 87..94
backend/app/controllers/event.rb on lines 69..76
backend/app/controllers/job.rb on lines 103..110
backend/app/controllers/rde_templates.rb on lines 39..46
backend/app/controllers/resource.rb on lines 101..108

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

  schemata.each do |object|
    begin
      serialize(object)
    rescue => e
      path = options.serializer.serialized_path(object)
Severity: Minor
Found in _yard/templates/default/fulldoc/html/setup.rb and 1 other location - About 15 mins to fix
_yard/templates/default/fulldoc/txt/setup.rb on lines 5..12

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

      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

  :schema => {
    "$schema" => "http://www.archivesspace.org/archivesspace.json",
    "version" => 1,
    "type" => "object",
    "parent" => "abstract_note",
Severity: Minor
Found in common/schemas/note_legal_status.rb and 1 other location - About 15 mins to fix
common/schemas/note_mandate.rb on lines 2..13

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

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

          if session[:top_container_previous_search]['location']
            @top_container_previous_search['location'] = session[:top_container_previous_search]['location']
            @top_container_previous_search['location']['id'] = @top_container_previous_search['location']['uri']
Severity: Minor
Found in frontend/app/controllers/top_containers_controller.rb and 3 other locations - About 15 mins to fix
frontend/app/controllers/top_containers_controller.rb on lines 20..22
frontend/app/controllers/top_containers_controller.rb on lines 25..27
frontend/app/controllers/top_containers_controller.rb on lines 30..32

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

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

    alter_table(:whosaidhello) do
      add_foreign_key([:accession_id], :accession, :key => :id)
      add_foreign_key([:resource_id], :resource, :key => :id)
      add_foreign_key([:digital_object_id], :digital_object, :key => :id)
Severity: Minor
Found in plugins/hello_world/migrations/001_hello_world_schema.rb and 3 other locations - About 15 mins to fix
common/db/migrations/001_create_base_schema.rb on lines 498..501
common/db/migrations/001_create_base_schema.rb on lines 1079..1082
common/db/migrations/001_create_base_schema.rb on lines 1126..1129

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

Severity
Category
Status
Source
Language