ucsdlib/damspas

View on GitHub

Showing 388 of 388 total issues

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

  has_attributes :name, :elementList, :externalAuthority,
    :scheme, :scheme_attributes,
    :nameElement, :nameElement_attributes, :nameValue,
    :givenNameElement, :givenNameElement_attributes, :givenNameValue,
    :fullNameElement, :fullNameElement_attributes, :fullNameValue,
Severity: Minor
Found in app/models/mads_conference_name.rb and 4 other locations - About 25 mins to fix
app/models/mads_corporate_name.rb on lines 3..12
app/models/mads_family_name.rb on lines 3..11
app/models/mads_name.rb on lines 3..11
app/models/mads_personal_name.rb on lines 3..11

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

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

  has_attributes :name, :elementList, :externalAuthority,
    :scheme, :scheme_attributes,
    :nameElement, :nameElement_attributes, :nameValue,
    :givenNameElement, :givenNameElement_attributes, :givenNameValue,
    :fullNameElement, :fullNameElement_attributes, :fullNameValue,
Severity: Minor
Found in app/models/mads_corporate_name.rb and 4 other locations - About 25 mins to fix
app/models/mads_conference_name.rb on lines 3..11
app/models/mads_family_name.rb on lines 3..11
app/models/mads_name.rb on lines 3..11
app/models/mads_personal_name.rb on lines 3..11

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

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

  has_attributes :name, :elementList, :externalAuthority,
    :scheme, :scheme_attributes,
    :nameElement, :nameElement_attributes, :nameValue,
    :givenNameElement, :givenNameElement_attributes, :givenNameValue,
    :fullNameElement, :fullNameElement_attributes, :fullNameValue,
Severity: Minor
Found in app/models/mads_personal_name.rb and 4 other locations - About 25 mins to fix
app/models/mads_conference_name.rb on lines 3..11
app/models/mads_corporate_name.rb on lines 3..12
app/models/mads_family_name.rb on lines 3..11
app/models/mads_name.rb on lines 3..11

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

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

  has_attributes :name, :elementList, :externalAuthority,
    :scheme, :scheme_attributes,
    :nameElement, :nameElement_attributes, :nameValue,
    :givenNameElement, :givenNameElement_attributes, :givenNameValue,
    :fullNameElement, :fullNameElement_attributes, :fullNameValue,
Severity: Minor
Found in app/models/mads_name.rb and 4 other locations - About 25 mins to fix
app/models/mads_conference_name.rb on lines 3..11
app/models/mads_corporate_name.rb on lines 3..12
app/models/mads_family_name.rb on lines 3..11
app/models/mads_personal_name.rb on lines 3..11

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

  def rdf
    @document = get_single_doc_via_search(1, {:q => "id:#{params[:id]}"} )
    authorize! :show, @document
    params[:xsl] = "normalize.xsl"
    data = get_html_data params, nil
Severity: Minor
Found in app/controllers/dams_resource_controller.rb and 1 other location - About 25 mins to fix
app/controllers/dams_resource_controller.rb on lines 125..131

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

  def dams42
    @document = get_single_doc_via_search(1, {:q => "id:#{params[:id]}"} )
    authorize! :show, @document
    params[:xsl] = "dams4.2.xsl"
    data = get_html_data params, nil
Severity: Minor
Found in app/controllers/dams_resource_controller.rb and 1 other location - About 25 mins to fix
app/controllers/dams_resource_controller.rb on lines 139..145

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

          if othr.relationship.first != nil && othr.relationship.first.personalName.first != nil
            othr_json[:name] = "#{Rails.configuration.id_namespace}#{othr.relationship.first.personalName.first.pid}"
          end
Severity: Minor
Found in lib/dams/dams_object.rb and 1 other location - About 25 mins to fix
lib/dams/dams_object.rb on lines 489..491

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

          if othr.relationship.first != nil && othr.relationship.first.corporateName.first != nil
            othr_json[:name] = "#{Rails.configuration.id_namespace}#{othr.relationship.first.corporateName.first.pid}"
          end
Severity: Minor
Found in lib/dams/dams_object.rb and 1 other location - About 25 mins to fix
lib/dams/dams_object.rb on lines 486..488

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

      def rightsHolderType=(val)
        @rightsHolderType = Array.new
        i = 0
        val.each do |v| 
            if(!v.nil? && v.length > 0)
Severity: Minor
Found in lib/dams/dams_helper.rb and 3 other locations - About 20 mins to fix
lib/dams/dams_helper.rb on lines 104..112
lib/dams/dams_helper.rb on lines 166..174
lib/dams/dams_helper.rb on lines 644..652

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

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

      def relationshipNameType=(val)
        @relNameType = Array.new
        i = 0
        val.each do |v| 
            if(!v.nil? && v.length > 0)
Severity: Minor
Found in lib/dams/dams_helper.rb and 3 other locations - About 20 mins to fix
lib/dams/dams_helper.rb on lines 104..112
lib/dams/dams_helper.rb on lines 166..174
lib/dams/dams_helper.rb on lines 814..822

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

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

      respond_to do |format|
        format.html
        format.json { render json: @document }
        format.rdf { render xml: @rdfxml }
        format.nt { rdf_nt }
Severity: Minor
Found in app/controllers/dams_resource_controller.rb and 1 other location - About 20 mins to fix
app/controllers/dams_resource_controller.rb on lines 102..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 28.

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

      respond_to do |format|
        format.html # show.html.erb
        format.json { render json: @document }
        format.rdf { render xml: @rdfxml }
        format.nt { rdf_nt }
Severity: Minor
Found in app/controllers/dams_resource_controller.rb and 1 other location - About 20 mins to fix
app/controllers/dams_resource_controller.rb on lines 110..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 28.

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 scheme.first
          Solrizer.insert_field(solr_doc, 'scheme', scheme.first.rdf_subject.to_s)
          Solrizer.insert_field(solr_doc, 'scheme_name', scheme.first.name.first)
          Solrizer.insert_field(solr_doc, 'scheme_code', scheme.first.code.first)
Severity: Minor
Found in lib/dams/mads_simple_type.rb and 1 other location - About 20 mins to fix
app/models/datastreams/mads_authority_datastream.rb on lines 60..63

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

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

      def subjectType=(val)
        @subType = Array.new
        i = 0
        val.each do |v| 
            if(!v.nil? && v.length > 0)
Severity: Minor
Found in lib/dams/dams_helper.rb and 3 other locations - About 20 mins to fix
lib/dams/dams_helper.rb on lines 166..174
lib/dams/dams_helper.rb on lines 644..652
lib/dams/dams_helper.rb on lines 814..822

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

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 scheme.first
      Solrizer.insert_field(solr_doc, 'scheme', scheme.first.rdf_subject.to_s)
      Solrizer.insert_field(solr_doc, 'scheme_name', scheme.first.name.first)
      Solrizer.insert_field(solr_doc, 'scheme_code', scheme.first.code.first)
Severity: Minor
Found in app/models/datastreams/mads_authority_datastream.rb and 1 other location - About 20 mins to fix
lib/dams/mads_simple_type.rb on lines 22..25

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

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

      def nameType=(val)
        @namesType = Array.new
        i = 0
            val.each do |v| 
                if(!v.nil? && v.length > 0)
Severity: Minor
Found in lib/dams/dams_helper.rb and 3 other locations - About 20 mins to fix
lib/dams/dams_helper.rb on lines 104..112
lib/dams/dams_helper.rb on lines 644..652
lib/dams/dams_helper.rb on lines 814..822

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

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

  def show
    parm={ :q => "id_t:#{params[:id]}" }
    @document = get_single_doc_via_search(1,parm)
    @current_personal_name = @document['name_tesim']
    #@carousel_resp, @carousel = get_search_results( :q => "title_tesim:carousel AND id_t:#{params[:id]}", :qt=>"standard")
Severity: Major
Found in app/controllers/mads_personal_names_controller.rb and 25 other locations - About 20 mins to fix
app/controllers/dams_anatomies_controller.rb on lines 10..15
app/controllers/dams_built_work_places_controller.rb on lines 10..16
app/controllers/dams_copyrights_controller.rb on lines 10..16
app/controllers/dams_cruises_controller.rb on lines 10..15
app/controllers/dams_cultural_contexts_controller.rb on lines 10..16
app/controllers/dams_functions_controller.rb on lines 10..16
app/controllers/dams_iconographies_controller.rb on lines 10..16
app/controllers/dams_licenses_controller.rb on lines 11..17
app/controllers/dams_lithologies_controller.rb on lines 10..15
app/controllers/dams_other_rights_controller.rb on lines 10..16
app/controllers/dams_scientific_names_controller.rb on lines 11..17
app/controllers/dams_series_controller.rb on lines 10..15
app/controllers/dams_statutes_controller.rb on lines 10..16
app/controllers/dams_style_periods_controller.rb on lines 10..16
app/controllers/dams_techniques_controller.rb on lines 10..16
app/controllers/mads_complex_subjects_controller.rb on lines 10..16
app/controllers/mads_conference_names_controller.rb on lines 10..16
app/controllers/mads_corporate_names_controller.rb on lines 10..15
app/controllers/mads_family_names_controller.rb on lines 10..16
app/controllers/mads_genre_forms_controller.rb on lines 10..16
app/controllers/mads_geographics_controller.rb on lines 11..17
app/controllers/mads_names_controller.rb on lines 10..16
app/controllers/mads_occupations_controller.rb on lines 10..16
app/controllers/mads_temporals_controller.rb on lines 10..16
app/controllers/mads_topics_controller.rb on lines 10..16

Duplicated Code

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

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

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

Tuning

This issue has a mass of 27.

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

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

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

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

Refactorings

Further Reading

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

  def show
    parm={ :q => "id_t:#{params[:id]}" }
    @document = get_single_doc_via_search(1,parm)
    @current_cruise = @document['name_tesim']
    @carousel_resp, @carousel = get_search_results( :q => "title_tesim:carousel")
Severity: Major
Found in app/controllers/dams_cruises_controller.rb and 25 other locations - About 20 mins to fix
app/controllers/dams_anatomies_controller.rb on lines 10..15
app/controllers/dams_built_work_places_controller.rb on lines 10..16
app/controllers/dams_copyrights_controller.rb on lines 10..16
app/controllers/dams_cultural_contexts_controller.rb on lines 10..16
app/controllers/dams_functions_controller.rb on lines 10..16
app/controllers/dams_iconographies_controller.rb on lines 10..16
app/controllers/dams_licenses_controller.rb on lines 11..17
app/controllers/dams_lithologies_controller.rb on lines 10..15
app/controllers/dams_other_rights_controller.rb on lines 10..16
app/controllers/dams_scientific_names_controller.rb on lines 11..17
app/controllers/dams_series_controller.rb on lines 10..15
app/controllers/dams_statutes_controller.rb on lines 10..16
app/controllers/dams_style_periods_controller.rb on lines 10..16
app/controllers/dams_techniques_controller.rb on lines 10..16
app/controllers/mads_complex_subjects_controller.rb on lines 10..16
app/controllers/mads_conference_names_controller.rb on lines 10..16
app/controllers/mads_corporate_names_controller.rb on lines 10..15
app/controllers/mads_family_names_controller.rb on lines 10..16
app/controllers/mads_genre_forms_controller.rb on lines 10..16
app/controllers/mads_geographics_controller.rb on lines 11..17
app/controllers/mads_names_controller.rb on lines 10..16
app/controllers/mads_occupations_controller.rb on lines 10..16
app/controllers/mads_personal_names_controller.rb on lines 10..16
app/controllers/mads_temporals_controller.rb on lines 10..16
app/controllers/mads_topics_controller.rb on lines 10..16

Duplicated Code

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

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

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

Tuning

This issue has a mass of 27.

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

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

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

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

Refactorings

Further Reading

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

  def show
    parm={ :q => "id_t:#{params[:id]}" }
    @document = get_single_doc_via_search(1,parm)
    @current_temporal = @document['name_tesim']
    #@carousel_resp, @carousel = get_search_results( :q => "title_tesim:carousel AND id_t:#{params[:id]}", :qt=>"standard")
Severity: Major
Found in app/controllers/mads_temporals_controller.rb and 25 other locations - About 20 mins to fix
app/controllers/dams_anatomies_controller.rb on lines 10..15
app/controllers/dams_built_work_places_controller.rb on lines 10..16
app/controllers/dams_copyrights_controller.rb on lines 10..16
app/controllers/dams_cruises_controller.rb on lines 10..15
app/controllers/dams_cultural_contexts_controller.rb on lines 10..16
app/controllers/dams_functions_controller.rb on lines 10..16
app/controllers/dams_iconographies_controller.rb on lines 10..16
app/controllers/dams_licenses_controller.rb on lines 11..17
app/controllers/dams_lithologies_controller.rb on lines 10..15
app/controllers/dams_other_rights_controller.rb on lines 10..16
app/controllers/dams_scientific_names_controller.rb on lines 11..17
app/controllers/dams_series_controller.rb on lines 10..15
app/controllers/dams_statutes_controller.rb on lines 10..16
app/controllers/dams_style_periods_controller.rb on lines 10..16
app/controllers/dams_techniques_controller.rb on lines 10..16
app/controllers/mads_complex_subjects_controller.rb on lines 10..16
app/controllers/mads_conference_names_controller.rb on lines 10..16
app/controllers/mads_corporate_names_controller.rb on lines 10..15
app/controllers/mads_family_names_controller.rb on lines 10..16
app/controllers/mads_genre_forms_controller.rb on lines 10..16
app/controllers/mads_geographics_controller.rb on lines 11..17
app/controllers/mads_names_controller.rb on lines 10..16
app/controllers/mads_occupations_controller.rb on lines 10..16
app/controllers/mads_personal_names_controller.rb on lines 10..16
app/controllers/mads_topics_controller.rb on lines 10..16

Duplicated Code

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

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

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

Tuning

This issue has a mass of 27.

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

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

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

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

Refactorings

Further Reading

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

  def show
    parm={ :q => "id_t:#{params[:id]}" }
    @document = get_single_doc_via_search(1,parm)
    @current_conference_name = @document['name_tesim']
    #@carousel_resp, @carousel = get_search_results( :q => "title_tesim:carousel AND id_t:#{params[:id]}", :qt=>"standard")
Severity: Major
Found in app/controllers/mads_conference_names_controller.rb and 25 other locations - About 20 mins to fix
app/controllers/dams_anatomies_controller.rb on lines 10..15
app/controllers/dams_built_work_places_controller.rb on lines 10..16
app/controllers/dams_copyrights_controller.rb on lines 10..16
app/controllers/dams_cruises_controller.rb on lines 10..15
app/controllers/dams_cultural_contexts_controller.rb on lines 10..16
app/controllers/dams_functions_controller.rb on lines 10..16
app/controllers/dams_iconographies_controller.rb on lines 10..16
app/controllers/dams_licenses_controller.rb on lines 11..17
app/controllers/dams_lithologies_controller.rb on lines 10..15
app/controllers/dams_other_rights_controller.rb on lines 10..16
app/controllers/dams_scientific_names_controller.rb on lines 11..17
app/controllers/dams_series_controller.rb on lines 10..15
app/controllers/dams_statutes_controller.rb on lines 10..16
app/controllers/dams_style_periods_controller.rb on lines 10..16
app/controllers/dams_techniques_controller.rb on lines 10..16
app/controllers/mads_complex_subjects_controller.rb on lines 10..16
app/controllers/mads_corporate_names_controller.rb on lines 10..15
app/controllers/mads_family_names_controller.rb on lines 10..16
app/controllers/mads_genre_forms_controller.rb on lines 10..16
app/controllers/mads_geographics_controller.rb on lines 11..17
app/controllers/mads_names_controller.rb on lines 10..16
app/controllers/mads_occupations_controller.rb on lines 10..16
app/controllers/mads_personal_names_controller.rb on lines 10..16
app/controllers/mads_temporals_controller.rb on lines 10..16
app/controllers/mads_topics_controller.rb on lines 10..16

Duplicated Code

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

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

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

Tuning

This issue has a mass of 27.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language