ucsdlib/damspas

View on GitHub
lib/dams/dams_helper.rb

Summary

Maintainability
F
5 days
Test Coverage

File dams_helper.rb has 752 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'active_support/inflector'

module Dams
    module DamsHelper
        
Severity: Major
Found in lib/dams/dams_helper.rb - About 1 day to fix

    Method setElementValue has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

          def setElementValue(type,val)
            if val.class == Array
                val = val.first
            end
    
    
    Severity: Minor
    Found in lib/dams/dams_helper.rb - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method loadRdfObjects has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

      def loadRdfObjects (object, className, reload = true)
        objects = []
        if !object.first.nil?
          object.each do |o|
            o_pid = o.pid;
    Severity: Minor
    Found in lib/dams/dams_helper.rb - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method setElementValue has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def setElementValue(type,val)
            if val.class == Array
                val = val.first
            end
    
    
    Severity: Major
    Found in lib/dams/dams_helper.rb - About 2 hrs to fix

      Method relationshipNameURI= has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

            def relationshipNameURI=(val)
                i = 0
                val.each do |v|
                  uri = v
                  if(!v.include? Rails.configuration.id_namespace)
      Severity: Minor
      Found in lib/dams/dams_helper.rb - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method relResourceURI= has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

            def relResourceURI=(val)
              if val.class == Array
                  #    val = val.first
                  @relResourceURI = Array.new
                  val.each do |v|
      Severity: Minor
      Found in lib/dams/dams_helper.rb - About 55 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method languageURI= has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

            def languageURI=(val)
              if val.class == Array
                  #    val = val.first
                  @langURI = Array.new
                  val.each do |v|
      Severity: Minor
      Found in lib/dams/dams_helper.rb - About 55 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method assembledCollectionURI= has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

            def assembledCollectionURI=(val)
            if val.class == Array
                # val = val.first
              @assembledCollURI = Array.new
              val.each do |v|
      Severity: Minor
      Found in lib/dams/dams_helper.rb - About 55 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method relationshipRoleURI= has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

            def relationshipRoleURI=(val)
                i = 0
                val.each do |v|
                  uri = v
                  if(!v.include? Rails.configuration.id_namespace)
      Severity: Minor
      Found in lib/dams/dams_helper.rb - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Consider simplifying this complex logical expression.
      Open

              if ( o_pid.nil? || o_pid.start_with?("_") || (o.respond_to?(:name) && !o.name.first.nil?) || (o.respond_to?(:value) && !o.value.first.nil?) )
                # inline records, use as-is
                objects << o
              else
                # unmapped records, fetch from repo
      Severity: Major
      Found in lib/dams/dams_helper.rb - About 40 mins to fix

        Method subjectURI= has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

              def subjectURI=(val)
                @subURI = Array.new
                @array_subject = Array.new
                val.each do |v|
                    uri = v
        Severity: Minor
        Found in lib/dams/dams_helper.rb - About 25 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

              def relResourceURI=(val)
                if val.class == Array
                    #    val = val.first
                    @relResourceURI = Array.new
                    val.each do |v|
        Severity: Major
        Found in lib/dams/dams_helper.rb and 2 other locations - About 1 hr to fix
        lib/dams/dams_helper.rb on lines 217..232
        lib/dams/dams_helper.rb on lines 280..295

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

        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

              def assembledCollectionURI=(val)
              if val.class == Array
                  # val = val.first
                @assembledCollURI = Array.new
                val.each do |v|
        Severity: Major
        Found in lib/dams/dams_helper.rb and 2 other locations - About 1 hr to fix
        lib/dams/dams_helper.rb on lines 217..232
        lib/dams/dams_helper.rb on lines 242..257

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

        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

              def languageURI=(val)
                if val.class == Array
                    #    val = val.first
                    @langURI = Array.new
                    val.each do |v|
        Severity: Major
        Found in lib/dams/dams_helper.rb and 2 other locations - About 1 hr to fix
        lib/dams/dams_helper.rb on lines 242..257
        lib/dams/dams_helper.rb on lines 280..295

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

        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

              def creatorURI=(val)
              @creatorURI = 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 793..802

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

              def simpleSubjectURI=(val)
                @simpleSubURI = 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 197..206
        lib/dams/dams_helper.rb on lines 793..802

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

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

                 def provenanceCollectionPartURI=(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 7 other locations - About 25 mins to fix
        lib/dams/dams_helper.rb on lines 262..268
        lib/dams/dams_helper.rb on lines 305..311
        lib/dams/dams_helper.rb on lines 336..342
        lib/dams/dams_helper.rb on lines 736..742
        lib/dams/dams_helper.rb on lines 750..756
        lib/dams/dams_helper.rb on lines 764..770
        lib/dams/dams_helper.rb on lines 778..784

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

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

              def unitURI=(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 7 other locations - About 25 mins to fix
        lib/dams/dams_helper.rb on lines 305..311
        lib/dams/dams_helper.rb on lines 321..327
        lib/dams/dams_helper.rb on lines 336..342
        lib/dams/dams_helper.rb on lines 736..742
        lib/dams/dams_helper.rb on lines 750..756
        lib/dams/dams_helper.rb on lines 764..770
        lib/dams/dams_helper.rb on lines 778..784

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

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

              def statuteURI=(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 7 other locations - About 25 mins to fix
        lib/dams/dams_helper.rb on lines 262..268
        lib/dams/dams_helper.rb on lines 305..311
        lib/dams/dams_helper.rb on lines 321..327
        lib/dams/dams_helper.rb on lines 336..342
        lib/dams/dams_helper.rb on lines 736..742
        lib/dams/dams_helper.rb on lines 764..770
        lib/dams/dams_helper.rb on lines 778..784

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

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

              def otherRightsURI=(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 7 other locations - About 25 mins to fix
        lib/dams/dams_helper.rb on lines 262..268
        lib/dams/dams_helper.rb on lines 305..311
        lib/dams/dams_helper.rb on lines 321..327
        lib/dams/dams_helper.rb on lines 336..342
        lib/dams/dams_helper.rb on lines 736..742
        lib/dams/dams_helper.rb on lines 750..756
        lib/dams/dams_helper.rb on lines 778..784

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

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

              def provenanceHasCollPartURI=(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 7 other locations - About 25 mins to fix
        lib/dams/dams_helper.rb on lines 262..268
        lib/dams/dams_helper.rb on lines 305..311
        lib/dams/dams_helper.rb on lines 321..327
        lib/dams/dams_helper.rb on lines 736..742
        lib/dams/dams_helper.rb on lines 750..756
        lib/dams/dams_helper.rb on lines 764..770
        lib/dams/dams_helper.rb on lines 778..784

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

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

              def copyrightURI=(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 7 other locations - About 25 mins to fix
        lib/dams/dams_helper.rb on lines 262..268
        lib/dams/dams_helper.rb on lines 305..311
        lib/dams/dams_helper.rb on lines 321..327
        lib/dams/dams_helper.rb on lines 336..342
        lib/dams/dams_helper.rb on lines 750..756
        lib/dams/dams_helper.rb on lines 764..770
        lib/dams/dams_helper.rb on lines 778..784

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

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

              def provenanceCollectionURI=(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 7 other locations - About 25 mins to fix
        lib/dams/dams_helper.rb on lines 262..268
        lib/dams/dams_helper.rb on lines 321..327
        lib/dams/dams_helper.rb on lines 336..342
        lib/dams/dams_helper.rb on lines 736..742
        lib/dams/dams_helper.rb on lines 750..756
        lib/dams/dams_helper.rb on lines 764..770
        lib/dams/dams_helper.rb on lines 778..784

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

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

              def licenseURI=(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 7 other locations - About 25 mins to fix
        lib/dams/dams_helper.rb on lines 262..268
        lib/dams/dams_helper.rb on lines 305..311
        lib/dams/dams_helper.rb on lines 321..327
        lib/dams/dams_helper.rb on lines 336..342
        lib/dams/dams_helper.rb on lines 736..742
        lib/dams/dams_helper.rb on lines 750..756
        lib/dams/dams_helper.rb on lines 764..770

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

        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

        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

        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

        There are no issues that match your filters.

        Category
        Status