ucsdlib/damspas

View on GitHub

Showing 162 of 388 total issues

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

      def rightsHolderURI=(val)
         @holderURI = Array.new
          val.each do |v|
            uri = v
            if(!v.include? Rails.configuration.id_namespace)
Severity: Major
Found in lib/dams/dams_helper.rb and 2 other locations - About 50 mins to fix
lib/dams/dams_helper.rb on lines 120..129
lib/dams/dams_helper.rb on lines 197..206

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

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 (typeName == 'relationshipName'){
    url = baseURL+"/get_"+typeGet+"/get_"+typeGet+"?&relationship=true&fieldName="+fieldName+"&formType="+type+"&q="+q;   
  }
Severity: Minor
Found in app/assets/javascripts/edit.js and 1 other location - About 45 mins to fix
app/assets/javascripts/edit.js on lines 416..418

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

  else {
    url = baseURL+"/get_"+typeGet+"/get_"+typeGet+"?fieldName="+fieldName+"&formType="+type+"&q="+q;
  }
Severity: Minor
Found in app/assets/javascripts/edit.js and 1 other location - About 45 mins to fix
app/assets/javascripts/edit.js on lines 413..415

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

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

  map_predicates do |map|
    map.name(:in => DAMS, :to => 'unitName')
    map.description(:in => DAMS, :to => 'unitDescription')
    map.uri(:in => DAMS, :to => 'unitURI')
    map.code(:in => DAMS, :to => 'code')
Severity: Minor
Found in app/models/dams_unit_internal.rb and 1 other location - About 45 mins to fix
app/models/datastreams/dams_unit_datastream.rb on lines 2..7

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

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

  map_predicates do |map|
    map.name(:in => DAMS, :to => 'unitName')
    map.description(:in => DAMS, :to => 'unitDescription')
    map.uri(:in => DAMS, :to => 'unitURI')
    map.code(:in => DAMS, :to => 'code')
Severity: Minor
Found in app/models/datastreams/dams_unit_datastream.rb and 1 other location - About 45 mins to fix
app/models/dams_unit_internal.rb on lines 14..19

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

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

          filter: function(items) {
                return $.map(items, function(item) { 
                       return { label: item.label, id: item.id }; 
                });
           }  
Severity: Minor
Found in app/assets/javascripts/edit.js and 1 other location - About 40 mins to fix
app/assets/javascripts/edit.js on lines 36..40

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

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

          filter: function(items) {
                return $.map(items, function(item) { 
                       return { label: item.label, id: item.id }; 
                });
           }  
Severity: Minor
Found in app/assets/javascripts/edit.js and 1 other location - About 40 mins to fix
app/assets/javascripts/edit.js on lines 19..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 48.

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

  map_predicates do |map|
    map.point(:in=>DAMS)
    map.line(:in=>DAMS)
    map.polygon(:in=>DAMS)
    map.projection(:in=>DAMS)
Severity: Minor
Found in app/models/dams_cartographics_internal.rb and 1 other location - About 35 mins to fix
app/models/datastreams/dams_cartographics_datastream.rb on lines 2..8

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

  map_predicates do |map|
    map.point(:in=>DAMS)
    map.line(:in=>DAMS)
    map.polygon(:in=>DAMS)
    map.projection(:in=>DAMS)
Severity: Minor
Found in app/models/datastreams/dams_cartographics_datastream.rb and 1 other location - About 35 mins to fix
app/models/dams_cartographics_internal.rb on lines 5..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 34.

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

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

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

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

Refactorings

Further Reading

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

      def cartographicPoint=(val)
        if val.class == Array
          val = val.first
        end
        if(!val.nil? && val.length > 0)
Severity: Major
Found in lib/dams/dams_helper.rb and 9 other locations - About 30 mins to fix
lib/dams/dams_helper.rb on lines 10..17
lib/dams/dams_helper.rb on lines 355..362
lib/dams/dams_helper.rb on lines 369..376
lib/dams/dams_helper.rb on lines 381..388
lib/dams/dams_helper.rb on lines 672..679
lib/dams/dams_helper.rb on lines 685..692
lib/dams/dams_helper.rb on lines 698..705
lib/dams/dams_helper.rb on lines 711..718
lib/dams/dams_helper.rb on lines 724..731

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

      def cartographicPolygon=(val)
        if val.class == Array
          val = val.first
        end
        if(!val.nil? && val.length > 0)
Severity: Major
Found in lib/dams/dams_helper.rb and 9 other locations - About 30 mins to fix
lib/dams/dams_helper.rb on lines 10..17
lib/dams/dams_helper.rb on lines 355..362
lib/dams/dams_helper.rb on lines 369..376
lib/dams/dams_helper.rb on lines 381..388
lib/dams/dams_helper.rb on lines 659..666
lib/dams/dams_helper.rb on lines 672..679
lib/dams/dams_helper.rb on lines 698..705
lib/dams/dams_helper.rb on lines 711..718
lib/dams/dams_helper.rb on lines 724..731

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

      def cartographicLine=(val)
        if val.class == Array
          val = val.first
        end
        if(!val.nil? && val.length > 0)
Severity: Major
Found in lib/dams/dams_helper.rb and 9 other locations - About 30 mins to fix
lib/dams/dams_helper.rb on lines 10..17
lib/dams/dams_helper.rb on lines 355..362
lib/dams/dams_helper.rb on lines 369..376
lib/dams/dams_helper.rb on lines 381..388
lib/dams/dams_helper.rb on lines 659..666
lib/dams/dams_helper.rb on lines 685..692
lib/dams/dams_helper.rb on lines 698..705
lib/dams/dams_helper.rb on lines 711..718
lib/dams/dams_helper.rb on lines 724..731

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

      def cartographicScale=(val)
        if val.class == Array
          val = val.first
        end
        if(!val.nil? && val.length > 0)
Severity: Major
Found in lib/dams/dams_helper.rb and 9 other locations - About 30 mins to fix
lib/dams/dams_helper.rb on lines 10..17
lib/dams/dams_helper.rb on lines 355..362
lib/dams/dams_helper.rb on lines 369..376
lib/dams/dams_helper.rb on lines 381..388
lib/dams/dams_helper.rb on lines 659..666
lib/dams/dams_helper.rb on lines 672..679
lib/dams/dams_helper.rb on lines 685..692
lib/dams/dams_helper.rb on lines 698..705
lib/dams/dams_helper.rb on lines 711..718

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

      def cartographicProjection=(val)
        if val.class == Array
          val = val.first
        end
        if(!val.nil? && val.length > 0)
Severity: Major
Found in lib/dams/dams_helper.rb and 9 other locations - About 30 mins to fix
lib/dams/dams_helper.rb on lines 10..17
lib/dams/dams_helper.rb on lines 355..362
lib/dams/dams_helper.rb on lines 369..376
lib/dams/dams_helper.rb on lines 381..388
lib/dams/dams_helper.rb on lines 659..666
lib/dams/dams_helper.rb on lines 672..679
lib/dams/dams_helper.rb on lines 685..692
lib/dams/dams_helper.rb on lines 711..718
lib/dams/dams_helper.rb on lines 724..731

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

      def beginDate=(val)
        if val.class == Array
          val = val.first
        end
        if(!val.nil? && val.length > 0)
Severity: Major
Found in lib/dams/dams_helper.rb and 9 other locations - About 30 mins to fix
lib/dams/dams_helper.rb on lines 10..17
lib/dams/dams_helper.rb on lines 369..376
lib/dams/dams_helper.rb on lines 381..388
lib/dams/dams_helper.rb on lines 659..666
lib/dams/dams_helper.rb on lines 672..679
lib/dams/dams_helper.rb on lines 685..692
lib/dams/dams_helper.rb on lines 698..705
lib/dams/dams_helper.rb on lines 711..718
lib/dams/dams_helper.rb on lines 724..731

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

      def endDate=(val)
        if val.class == Array
            val = val.first
        end  
        if(!val.nil? && val.length > 0)
Severity: Major
Found in lib/dams/dams_helper.rb and 9 other locations - About 30 mins to fix
lib/dams/dams_helper.rb on lines 10..17
lib/dams/dams_helper.rb on lines 355..362
lib/dams/dams_helper.rb on lines 381..388
lib/dams/dams_helper.rb on lines 659..666
lib/dams/dams_helper.rb on lines 672..679
lib/dams/dams_helper.rb on lines 685..692
lib/dams/dams_helper.rb on lines 698..705
lib/dams/dams_helper.rb on lines 711..718
lib/dams/dams_helper.rb on lines 724..731

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

      def dateValue=(val)
        if val.class == Array
            val = val.first
        end  
        if(!val.nil? && val.length > 0)
Severity: Major
Found in lib/dams/dams_helper.rb and 9 other locations - About 30 mins to fix
lib/dams/dams_helper.rb on lines 10..17
lib/dams/dams_helper.rb on lines 355..362
lib/dams/dams_helper.rb on lines 369..376
lib/dams/dams_helper.rb on lines 659..666
lib/dams/dams_helper.rb on lines 672..679
lib/dams/dams_helper.rb on lines 685..692
lib/dams/dams_helper.rb on lines 698..705
lib/dams/dams_helper.rb on lines 711..718
lib/dams/dams_helper.rb on lines 724..731

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

      def cartographicRefSystem=(val)
        if val.class == Array
          val = val.first
        end
        if(!val.nil? && val.length > 0)
Severity: Major
Found in lib/dams/dams_helper.rb and 9 other locations - About 30 mins to fix
lib/dams/dams_helper.rb on lines 10..17
lib/dams/dams_helper.rb on lines 355..362
lib/dams/dams_helper.rb on lines 369..376
lib/dams/dams_helper.rb on lines 381..388
lib/dams/dams_helper.rb on lines 659..666
lib/dams/dams_helper.rb on lines 672..679
lib/dams/dams_helper.rb on lines 685..692
lib/dams/dams_helper.rb on lines 698..705
lib/dams/dams_helper.rb on lines 724..731

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

      def subtitle=(val)
        if val.class == Array
            val = val.first
        end
        if(!val.nil? && val.length > 0)
Severity: Major
Found in lib/dams/dams_helper.rb and 9 other locations - About 30 mins to fix
lib/dams/dams_helper.rb on lines 355..362
lib/dams/dams_helper.rb on lines 369..376
lib/dams/dams_helper.rb on lines 381..388
lib/dams/dams_helper.rb on lines 659..666
lib/dams/dams_helper.rb on lines 672..679
lib/dams/dams_helper.rb on lines 685..692
lib/dams/dams_helper.rb on lines 698..705
lib/dams/dams_helper.rb on lines 711..718
lib/dams/dams_helper.rb on lines 724..731

Duplicated Code

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

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

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

Tuning

This issue has a mass of 33.

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

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

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

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

Refactorings

Further Reading

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

  map_predicates do |map|
    map.type(:in => DAMS, :to => 'type')
    map.eventDate(:in => DAMS, :to => 'eventDate')
    map.outcome(:in => DAMS, :to => 'outcome')
    map.relationship(:in => DAMS, :class_name => 'DamsRelationshipInternal')
Severity: Minor
Found in app/models/dams_event_internal.rb and 1 other location - About 30 mins to fix
app/models/datastreams/dams_event_datastream.rb on lines 2..6

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

Severity
Category
Status
Source
Language