archivesspace/archivesspace

View on GitHub
backend/app/controllers/exports.rb

Summary

Maintainability
F
3 days
Test Coverage

File exports.rb has 696 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class ArchivesSpaceService < Sinatra::Base
  include ExportHelpers

  Endpoint.get('/repositories/:repo_id/digital_objects/dublin_core/:id.xml')
    .description("Get a Dublin Core representation of a Digital Object")
Severity: Major
Found in backend/app/controllers/exports.rb - About 1 day to fix

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

      Endpoint.get('/repositories/:repo_id/archival_contexts/people/:id.:fmt/metadata')
        .description("Get metadata for an EAC-CPF export of a person")
        .example("shell") do
          <<~SHELL
            curl -s -F password="admin" "http://localhost:8089/users/admin/login"
    Severity: Major
    Found in backend/app/controllers/exports.rb and 2 other locations - About 1 hr to fix
    backend/app/controllers/exports.rb on lines 606..643
    backend/app/controllers/exports.rb on lines 684..721

    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

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

      Endpoint.get('/repositories/:repo_id/archival_contexts/corporate_entities/:id.:fmt/metadata')
        .description("Get metadata for an EAC-CPF export of a corporate entity")
        .example("shell") do
          <<~SHELL
            curl -s -F password="admin" "http://localhost:8089/users/admin/login"
    Severity: Major
    Found in backend/app/controllers/exports.rb and 2 other locations - About 1 hr to fix
    backend/app/controllers/exports.rb on lines 528..565
    backend/app/controllers/exports.rb on lines 684..721

    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

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

      Endpoint.get('/repositories/:repo_id/archival_contexts/families/:id.:fmt/metadata')
        .description("Get metadata for an EAC-CPF export of a family")
        .example("shell") do
          <<~SHELL
            curl -s -F password="admin" "http://localhost:8089/users/admin/login"
    Severity: Major
    Found in backend/app/controllers/exports.rb and 2 other locations - About 1 hr to fix
    backend/app/controllers/exports.rb on lines 528..565
    backend/app/controllers/exports.rb on lines 606..643

    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

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

      Endpoint.get('/repositories/:repo_id/agents/people/marc21/:id.:fmt/metadata')
              .description('Get metadata for an MARC Auth export of a person')
              .params(['id', :id],
                      ['repo_id', :repo_id])
              .permissions([:view_repository])
    Severity: Major
    Found in backend/app/controllers/exports.rb and 2 other locations - About 1 hr to fix
    backend/app/controllers/exports.rb on lines 771..782
    backend/app/controllers/exports.rb on lines 785..796

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

      Endpoint.get('/repositories/:repo_id/agents/families/marc21/:id.:fmt/metadata')
              .description('Get metadata for an MARC Auth export of a family')
              .params(['id', :id],
                      ['repo_id', :repo_id])
              .permissions([:view_repository])
    Severity: Major
    Found in backend/app/controllers/exports.rb and 2 other locations - About 1 hr to fix
    backend/app/controllers/exports.rb on lines 757..768
    backend/app/controllers/exports.rb on lines 771..782

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

      Endpoint.get('/repositories/:repo_id/agents/corporate_entities/marc21/:id.:fmt/metadata')
              .description('Get metadata for an MARC Auth export of a corporate entity')
              .params(['id', :id],
                      ['repo_id', :repo_id])
              .permissions([:view_repository])
    Severity: Major
    Found in backend/app/controllers/exports.rb and 2 other locations - About 1 hr to fix
    backend/app/controllers/exports.rb on lines 757..768
    backend/app/controllers/exports.rb on lines 785..796

    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

      Endpoint.get('/repositories/:repo_id/resources/marc21/:id.xml')
        .description("Get a MARC 21 representation of a Resource")
        .example("shell") do
          <<~SHELL
            curl -s -F password="admin" "http://localhost:8089/users/admin/login"
    Severity: Minor
    Found in backend/app/controllers/exports.rb and 1 other location - About 55 mins to fix
    backend/app/controllers/exports.rb on lines 79..115

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

    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.get('/repositories/:repo_id/digital_objects/mets/:id.xml')
        .description("Get a METS representation of a Digital Object")
        .example("shell") do
          <<~SHELL
            curl -s -F password="admin" "http://localhost:8089/users/admin/login"
    Severity: Minor
    Found in backend/app/controllers/exports.rb and 1 other location - About 55 mins to fix
    backend/app/controllers/exports.rb on lines 230..269

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

    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.get('/repositories/:repo_id/resources/:id/templates/top_container_creation.csv')
        .description("Get a CSV template useful for bulk-creating containers for archival objects of a resource")
        .documentation do
          <<~DOCS
            This method returns a spreadsheet representing all the archival objects in a resource, with the following  fields:
    Severity: Minor
    Found in backend/app/controllers/exports.rb and 1 other location - About 55 mins to fix
    backend/app/controllers/exports.rb on lines 845..883

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 44.

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

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

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

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

    Refactorings

    Further Reading

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

      Endpoint.get('/repositories/:repo_id/resources/:id/templates/digital_object_creation.csv')
        .description("Get a CSV template useful for bulk-creating digitial objects for archival objects of a resource")
        .documentation do
          <<~DOCS
            This method returns a spreadsheet representing all the archival objects in a resource, with the following  fields:
    Severity: Minor
    Found in backend/app/controllers/exports.rb and 1 other location - About 55 mins to fix
    backend/app/controllers/exports.rb on lines 799..842

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 44.

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

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

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

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

    Refactorings

    Further Reading

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

      Endpoint.get('/repositories/:repo_id/digital_objects/dublin_core/:id.:fmt/metadata')
        .description("Get metadata for a Dublin Core export")
        .example("shell") do
          <<~SHELL
            curl -s -F password="admin" "http://localhost:8089/users/admin/login"
    Severity: Major
    Found in backend/app/controllers/exports.rb and 2 other locations - About 45 mins to fix
    backend/app/controllers/exports.rb on lines 118..153
    backend/app/controllers/exports.rb on lines 192..227

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

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

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

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

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

    Refactorings

    Further Reading

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

      Endpoint.get('/repositories/:repo_id/digital_objects/mets/:id.:fmt/metadata')
        .description("Get metadata for a METS export")
        .example("shell") do
          <<~SHELL
            curl -s -F password="admin" "http://localhost:8089/users/admin/login"
    Severity: Major
    Found in backend/app/controllers/exports.rb and 2 other locations - About 45 mins to fix
    backend/app/controllers/exports.rb on lines 42..76
    backend/app/controllers/exports.rb on lines 192..227

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

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

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

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

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

    Refactorings

    Further Reading

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

      Endpoint.get('/repositories/:repo_id/digital_objects/mods/:id.:fmt/metadata')
        .description("Get metadata for a MODS export")
        .example("shell") do
          <<~SHELL
            curl -s -F password="admin" "http://localhost:8089/users/admin/login"
    Severity: Major
    Found in backend/app/controllers/exports.rb and 2 other locations - About 45 mins to fix
    backend/app/controllers/exports.rb on lines 42..76
    backend/app/controllers/exports.rb on lines 118..153

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

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

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

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

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

    Refactorings

    Further Reading

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

      Endpoint.get('/repositories/:repo_id/digital_objects/mods/:id.xml')
        .description("Get a MODS representation of a Digital Object ")
        .example("shell") do
          <<~SHELL
            curl -s -F password="admin" "http://localhost:8089/users/admin/login"
    Severity: Minor
    Found in backend/app/controllers/exports.rb and 2 other locations - About 35 mins to fix
    backend/app/controllers/exports.rb on lines 6..39
    backend/app/controllers/exports.rb on lines 413..449

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

      Endpoint.get('/repositories/:repo_id/archival_contexts/people/:id.xml')
        .description("Get an EAC-CPF representation of an Agent")
        .example("shell") do
          <<~SHELL
            curl -s -F password="admin" "http://localhost:8089/users/admin/login"
    Severity: Minor
    Found in backend/app/controllers/exports.rb and 2 other locations - About 35 mins to fix
    backend/app/controllers/exports.rb on lines 568..603
    backend/app/controllers/exports.rb on lines 646..681

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

      Endpoint.get('/repositories/:repo_id/archival_contexts/families/:id.xml')
        .description("Get an EAC-CPF representation of a Family")
        .example("shell") do
          <<~SHELL
            curl -s -F password="admin" "http://localhost:8089/users/admin/login"
    Severity: Minor
    Found in backend/app/controllers/exports.rb and 2 other locations - About 35 mins to fix
    backend/app/controllers/exports.rb on lines 490..525
    backend/app/controllers/exports.rb on lines 568..603

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

      Endpoint.get('/repositories/:repo_id/digital_objects/dublin_core/:id.xml')
        .description("Get a Dublin Core representation of a Digital Object")
        .example("shell") do
          <<~SHELL
            curl -s -F password="admin" "http://localhost:8089/users/admin/login"
    Severity: Minor
    Found in backend/app/controllers/exports.rb and 2 other locations - About 35 mins to fix
    backend/app/controllers/exports.rb on lines 156..189
    backend/app/controllers/exports.rb on lines 413..449

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

      Endpoint.get('/repositories/:repo_id/resource_labels/:id.tsv')
        .description("Get a tsv list of printable labels for a Resource")
        .example("shell") do
          <<~SHELL
            curl -s -F password="admin" "http://localhost:8089/users/admin/login"
    Severity: Minor
    Found in backend/app/controllers/exports.rb and 2 other locations - About 35 mins to fix
    backend/app/controllers/exports.rb on lines 6..39
    backend/app/controllers/exports.rb on lines 156..189

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

      Endpoint.get('/repositories/:repo_id/archival_contexts/corporate_entities/:id.xml')
        .description("Get an EAC-CPF representation of a Corporate Entity")
        .example("shell") do
          <<~SHELL
            curl -s -F password="admin" "http://localhost:8089/users/admin/login"
    Severity: Minor
    Found in backend/app/controllers/exports.rb and 2 other locations - About 35 mins to fix
    backend/app/controllers/exports.rb on lines 490..525
    backend/app/controllers/exports.rb on lines 646..681

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

      Endpoint.get('/repositories/:repo_id/agents/people/marc21/:id.xml')
              .description('Get an MARC Auth representation of an Person')
              .params(['id', :id],
                      ['repo_id', :repo_id])
              .permissions([:view_repository])
    Severity: Minor
    Found in backend/app/controllers/exports.rb and 2 other locations - About 25 mins to fix
    backend/app/controllers/exports.rb on lines 735..743
    backend/app/controllers/exports.rb on lines 746..754

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

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

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

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

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

    Refactorings

    Further Reading

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

      Endpoint.get('/repositories/:repo_id/agents/corporate_entities/marc21/:id.xml')
              .description('Get a MARC Auth representation of a Corporate Entity')
              .params(['id', :id],
                      ['repo_id', :repo_id])
              .permissions([:view_repository])
    Severity: Minor
    Found in backend/app/controllers/exports.rb and 2 other locations - About 25 mins to fix
    backend/app/controllers/exports.rb on lines 724..732
    backend/app/controllers/exports.rb on lines 746..754

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

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

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

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

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

    Refactorings

    Further Reading

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

      Endpoint.get('/repositories/:repo_id/agents/families/marc21/:id.xml')
              .description('Get an MARC Auth representation of a Family')
              .params(['id', :id],
                      ['repo_id', :repo_id])
              .permissions([:view_repository])
    Severity: Minor
    Found in backend/app/controllers/exports.rb and 2 other locations - About 25 mins to fix
    backend/app/controllers/exports.rb on lines 724..732
    backend/app/controllers/exports.rb on lines 735..743

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

    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