archivesspace/archivesspace

View on GitHub
common/db/migrations/001_create_base_schema.rb

Summary

Maintainability
F
4 days
Test Coverage

File 001_create_base_schema.rb has 1182 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require_relative 'utils'


Sequel.migration do
  up do
Severity: Major
Found in common/db/migrations/001_create_base_schema.rb - About 3 days to fix

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

        alter_table(:event_link_rlshp) do
          add_foreign_key([:accession_id], :accession, :key => :id)
          add_foreign_key([:resource_id], :resource, :key => :id)
          add_foreign_key([:archival_object_id], :archival_object, :key => :id)
          add_foreign_key([:digital_object_id], :digital_object, :key => :id)
    Severity: Major
    Found in common/db/migrations/001_create_base_schema.rb and 1 other location - About 1 hr to fix
    common/db/migrations/018_make_external_ids_into_nested_records.rb on lines 24..33

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

    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(:date) do
          add_foreign_key([:accession_id], :accession, :key => :id)
          add_foreign_key([:archival_object_id], :archival_object, :key => :id)
          add_foreign_key([:resource_id], :resource, :key => :id)
          add_foreign_key([:event_id], :event, :key => :id)
    Severity: Major
    Found in common/db/migrations/001_create_base_schema.rb and 3 other locations - About 1 hr to fix
    common/db/migrations/001_create_base_schema.rb on lines 847..855
    common/db/migrations/019_add_notes_table.rb on lines 28..36
    common/db/migrations/149_metadata_rights_statement_enum.rb on lines 35..43

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

    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(:related_agents_rlshp) do
          add_foreign_key([:agent_person_id_0], :agent_person, :key => :id)
          add_foreign_key([:agent_person_id_1], :agent_person, :key => :id)
          add_foreign_key([:agent_corporate_entity_id_0], :agent_corporate_entity, :key => :id)
          add_foreign_key([:agent_corporate_entity_id_1], :agent_corporate_entity, :key => :id)
    Severity: Major
    Found in common/db/migrations/001_create_base_schema.rb and 3 other locations - About 1 hr to fix
    common/db/migrations/001_create_base_schema.rb on lines 920..928
    common/db/migrations/019_add_notes_table.rb on lines 28..36
    common/db/migrations/149_metadata_rights_statement_enum.rb on lines 35..43

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

    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

        alter_table(:extent) do
          add_foreign_key([:accession_id], :accession, :key => :id)
          add_foreign_key([:archival_object_id], :archival_object, :key => :id)
          add_foreign_key([:resource_id], :resource, :key => :id)
          add_foreign_key([:deaccession_id], :deaccession, :key => :id)
    Severity: Minor
    Found in common/db/migrations/001_create_base_schema.rb and 1 other location - About 55 mins to fix
    common/db/migrations/001_create_base_schema.rb on lines 1531..1537

    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

        alter_table(:subject_rlshp) do
          add_foreign_key([:accession_id], :accession, :key => :id)
          add_foreign_key([:archival_object_id], :archival_object, :key => :id)
          add_foreign_key([:resource_id], :resource, :key => :id)
          add_foreign_key([:digital_object_id], :digital_object, :key => :id)
    Severity: Minor
    Found in common/db/migrations/001_create_base_schema.rb and 1 other location - About 55 mins to fix
    common/db/migrations/001_create_base_schema.rb on lines 815..821

    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

        alter_table(:archival_object) do
          add_foreign_key([:repo_id], :repository, :key => :id)
          add_foreign_key([:root_record_id], :resource, :key => :id)
          add_foreign_key([:parent_id], :archival_object, :key => :id)
    
    
    Severity: Minor
    Found in common/db/migrations/001_create_base_schema.rb and 1 other location - About 45 mins to fix
    common/db/migrations/001_create_base_schema.rb on lines 472..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 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 2 locations. Consider refactoring.
    Open

        alter_table(:digital_object_component) do
          add_foreign_key([:repo_id], :repository, :key => :id)
          add_foreign_key([:root_record_id], :digital_object, :key => :id)
          add_foreign_key([:parent_id], :digital_object_component, :key => :id)
    
    
    Severity: Minor
    Found in common/db/migrations/001_create_base_schema.rb and 1 other location - About 45 mins to fix
    common/db/migrations/001_create_base_schema.rb on lines 400..407

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

        alter_table(:classification_creator_rlshp) do
          add_foreign_key([:agent_person_id], :agent_person, :key => :id)
          add_foreign_key([:agent_family_id], :agent_family, :key => :id)
          add_foreign_key([:agent_corporate_entity_id], :agent_corporate_entity, :key => :id)
          add_foreign_key([:agent_software_id], :agent_software, :key => :id)
    Severity: Major
    Found in common/db/migrations/001_create_base_schema.rb and 3 other locations - About 45 mins to fix
    common/db/migrations/001_create_base_schema.rb on lines 1617..1623
    common/db/migrations/093_assessment_module.rb on lines 74..79
    common/db/migrations/157_fk_constraints_for_agent_subrecords.rb on lines 15..20

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

    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(:classification_term_creator_rlshp) do
          add_foreign_key([:agent_person_id], :agent_person, :key => :id)
          add_foreign_key([:agent_family_id], :agent_family, :key => :id)
          add_foreign_key([:agent_corporate_entity_id], :agent_corporate_entity, :key => :id)
          add_foreign_key([:agent_software_id], :agent_software, :key => :id)
    Severity: Major
    Found in common/db/migrations/001_create_base_schema.rb and 3 other locations - About 45 mins to fix
    common/db/migrations/001_create_base_schema.rb on lines 1592..1598
    common/db/migrations/093_assessment_module.rb on lines 74..79
    common/db/migrations/157_fk_constraints_for_agent_subrecords.rb on lines 15..20

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

    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

                             ["accession", "accumulation",
                              "acknowledgement_sent", "acknowledgement_received",
                              "agreement_signed", "agreement_received",
                              "agreement_sent", "appraisal", "assessment", "capture",
                              "cataloged", "collection", "compression",
    Severity: Minor
    Found in common/db/migrations/001_create_base_schema.rb and 1 other location - About 30 mins to fix
    backend/app/model/repository.rb on lines 59..69

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 33.

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

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

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

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

    Refactorings

    Further Reading

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

        alter_table(:agent_contact) do
          add_foreign_key([:agent_person_id], :agent_person, :key => :id)
          add_foreign_key([:agent_family_id], :agent_family, :key => :id)
          add_foreign_key([:agent_corporate_entity_id], :agent_corporate_entity, :key => :id)
          add_foreign_key([:agent_software_id], :agent_software, :key => :id)
    Severity: Major
    Found in common/db/migrations/001_create_base_schema.rb and 4 other locations - About 30 mins to fix
    common/db/migrations/001_create_base_schema.rb on lines 1640..1644
    common/db/migrations/021_agent_name_changes.rb on lines 60..64
    common/db/migrations/123_create_lang_materials_schema.rb on lines 142..146
    common/db/migrations/157_fk_constraints_for_agent_subrecords.rb on lines 23..27

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 32.

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

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

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

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

    Refactorings

    Further Reading

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

        alter_table(:classification_rlshp) do
          add_foreign_key([:resource_id], :resource, :key => :id)
          add_foreign_key([:accession_id], :accession, :key => :id)
          add_foreign_key([:classification_id], :classification, :key => :id)
          add_foreign_key([:classification_term_id], :classification_term, :key => :id)
    Severity: Major
    Found in common/db/migrations/001_create_base_schema.rb and 4 other locations - About 30 mins to fix
    common/db/migrations/001_create_base_schema.rb on lines 755..759
    common/db/migrations/021_agent_name_changes.rb on lines 60..64
    common/db/migrations/123_create_lang_materials_schema.rb on lines 142..146
    common/db/migrations/157_fk_constraints_for_agent_subrecords.rb on lines 23..27

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 32.

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

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

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

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

    Refactorings

    Further Reading

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

        create_table(:agent_family) do
          primary_key :id
    
          Integer :lock_version, :default => 0, :null => false
          Integer :json_schema_version, :null => false
    Severity: Minor
    Found in common/db/migrations/001_create_base_schema.rb and 2 other locations - About 25 mins to fix
    common/db/migrations/001_create_base_schema.rb on lines 66..77
    common/db/migrations/001_create_base_schema.rb on lines 96..107

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

    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

        create_table(:agent_corporate_entity) do
          primary_key :id
    
          Integer :lock_version, :default => 0, :null => false
          Integer :json_schema_version, :null => false
    Severity: Minor
    Found in common/db/migrations/001_create_base_schema.rb and 2 other locations - About 25 mins to fix
    common/db/migrations/001_create_base_schema.rb on lines 66..77
    common/db/migrations/001_create_base_schema.rb on lines 81..92

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

    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

        create_table(:agent_person) do
          primary_key :id
    
          Integer :lock_version, :default => 0, :null => false
          Integer :json_schema_version, :null => false
    Severity: Minor
    Found in common/db/migrations/001_create_base_schema.rb and 2 other locations - About 25 mins to fix
    common/db/migrations/001_create_base_schema.rb on lines 81..92
    common/db/migrations/001_create_base_schema.rb on lines 96..107

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

    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

        alter_table(:linked_agent_term) do
          add_foreign_key([:linked_agents_rlshp_id], :linked_agents_rlshp, :key => :id)
          add_foreign_key([:term_id], :term, :key => :id)
          add_index([:linked_agents_rlshp_id, :term_id], :name => "linked_agent_term_idx")
    Severity: Minor
    Found in common/db/migrations/001_create_base_schema.rb and 2 other locations - About 15 mins to fix
    common/db/migrations/001_create_base_schema.rb on lines 617..620
    common/db/migrations/016_add_preferences_table.rb on lines 23..26

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

                    [ "application",
                      "application-pdf",
                      "audio-clip",
                     "audio-master",
                     "audio-master-edited",
    Severity: Minor
    Found in common/db/migrations/001_create_base_schema.rb and 1 other location - About 15 mins to fix
    frontend/app/controllers/application_controller.rb on lines 243..251

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

        alter_table(:subject_term) do
          add_foreign_key([:subject_id], :subject, :key => :id)
          add_foreign_key([:term_id], :term, :key => :id)
          add_index([:subject_id, :term_id], :name => "subject_term_idx")
    Severity: Minor
    Found in common/db/migrations/001_create_base_schema.rb and 2 other locations - About 15 mins to fix
    common/db/migrations/001_create_base_schema.rb on lines 1461..1464
    common/db/migrations/016_add_preferences_table.rb on lines 23..26

    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(:user_defined) 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 common/db/migrations/001_create_base_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
    plugins/hello_world/migrations/001_hello_world_schema.rb on lines 20..23

    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(:instance) do
          add_foreign_key([:resource_id], :resource, :key => :id)
          add_foreign_key([:archival_object_id], :archival_object, :key => :id)
          add_foreign_key([:accession_id], :accession, :key => :id)
    Severity: Minor
    Found in common/db/migrations/001_create_base_schema.rb and 3 other locations - About 15 mins to fix
    common/db/migrations/001_create_base_schema.rb on lines 1079..1082
    common/db/migrations/001_create_base_schema.rb on lines 1126..1129
    plugins/hello_world/migrations/001_hello_world_schema.rb on lines 20..23

    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(:collection_management) 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 common/db/migrations/001_create_base_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 1126..1129
    plugins/hello_world/migrations/001_hello_world_schema.rb on lines 20..23

    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