sanger/limber

View on GitHub

Showing 177 of 177 total issues

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

  def update_all_labware_metadata(robot_barcode)
    @robot.beds.each_value do |bed|
      next unless bed.transitions? && bed.labware
      update_bed_labware_metadata(bed, robot_barcode)
    rescue Sequencescape::Api::ResourceNotFound
Severity: Minor
Found in app/controllers/robots_controller.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

Function byGroupByPlate has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

function byGroupByPlate(_well, tags, relIndex, _absIndex, offset, _counters) {
Severity: Minor
Found in app/frontend/javascript/custom-tagged-plate/tagLayoutFunctions.js - About 45 mins to fix

    Function processTagsPerWell has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function processTagsPerWell(acc, well, relIndex, absIndex, tagsPerWell, walker) {
    Severity: Minor
    Found in app/frontend/javascript/custom-tagged-plate/tagLayoutFunctions.js - About 45 mins to fix

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

          def wells_have_required_information
            filtered_wells.each do |well|
              next if well.aliquots.empty?
      
              errors.add(:csv_file, format(MISSING_WELL_DETAIL, well.location)) unless well_details.include? well.location
      Severity: Minor
      Found in app/models/labware_creators/pcr_cycles_binned_plate_base.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

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

          def generate_position_details_hash
            return {} unless valid?
      
            tube_rack_scan.each_with_object({}) do |row, position_details_hash|
              # ignore blank rows in file

      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

      Function byPlateFixed has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function byPlateFixed(_well, tags, _relIndex, absIndex, offset, _counters) {
      Severity: Minor
      Found in app/frontend/javascript/custom-tagged-plate/tagLayoutFunctions.js - About 45 mins to fix

        Function byPlateSeq has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function byPlateSeq(_well, tags, relIndex, _absIndex, offset, _counters) {
        Severity: Minor
        Found in app/frontend/javascript/custom-tagged-plate/tagLayoutFunctions.js - About 45 mins to fix

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

              def build_pools
                pools = []
                current_pool = 0
          
                # wells_grouped_by_collected_by = {0=>['w1', 'w4'], 1=>['w6', 'w2'], 2=>['w9', 'w23']}
          Severity: Minor
          Found in app/models/labware_creators/cardinal_pools_plate.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

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

              def build_transfers_hash(bins, number_of_rows, compression_reqd) # rubocop:todo Metrics/AbcSize
                binner = Binner.new(compression_reqd, number_of_rows)
                bins
                  .values
                  .each_with_object({})
          Severity: Minor
          Found in app/models/utility/normalised_binning_calculator.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

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

            {
              "resource": "tag_group",
              "attributes": {
                "uuid": "",
                "name": "",
          Severity: Minor
          Found in app/frontend/javascript/shared/resources.js and 1 other location - About 45 mins to fix
          app/frontend/javascript/shared/resources.js on lines 345..358

          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

            def coerce
              extend("limber/tag_layout_template/in_#{direction.gsub(/\s+/, '_')}s".camelize.constantize)
              extend("limber/tag_layout_template/walk_#{walking_by.gsub(/\s+/, '_')}".camelize.constantize)
            rescue NameError => e
              Rails.logger.warn("Unrecognised layout options: #{e.message}")
          Severity: Minor
          Found in app/sequencescape/sequencescape/api/v2/tag_layout_template.rb and 1 other location - About 45 mins to fix
          app/models/limber/tag_layout_template.rb on lines 6..14

          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

            def coerce
              extend("limber/tag_layout_template/in_#{direction.gsub(/\s+/, '_')}s".camelize.constantize)
              extend("limber/tag_layout_template/walk_#{walking_by.gsub(/\s+/, '_')}".camelize.constantize)
            rescue NameError => e
              Rails.logger.warn("Unrecognised layout options: #{e.message}")
          Severity: Minor
          Found in app/models/limber/tag_layout_template.rb and 1 other location - About 45 mins to fix
          app/sequencescape/sequencescape/api/v2/tag_layout_template.rb on lines 14..22

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 39.

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

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

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

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

          Refactorings

          Further Reading

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

            {
              "resource": "from_plate_to_specific_tubes_by_pool",
              "attributes": {
                "uuid": "",
                "source_uuid": "",
          Severity: Major
          Found in app/frontend/javascript/shared/resources.js and 11 other locations - About 40 mins to fix
          app/frontend/javascript/shared/resources.js on lines 57..69
          app/frontend/javascript/shared/resources.js on lines 97..109
          app/frontend/javascript/shared/resources.js on lines 110..122
          app/frontend/javascript/shared/resources.js on lines 123..135
          app/frontend/javascript/shared/resources.js on lines 136..148
          app/frontend/javascript/shared/resources.js on lines 149..161
          app/frontend/javascript/shared/resources.js on lines 191..203
          app/frontend/javascript/shared/resources.js on lines 217..229
          app/frontend/javascript/shared/resources.js on lines 230..242
          app/frontend/javascript/shared/resources.js on lines 243..255
          app/frontend/javascript/shared/resources.js on lines 951..963

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

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

            {
              "resource": "from_plate_to_tube_by_submission",
              "attributes": {
                "uuid": "",
                "source_uuid": "",
          Severity: Major
          Found in app/frontend/javascript/shared/resources.js and 11 other locations - About 40 mins to fix
          app/frontend/javascript/shared/resources.js on lines 57..69
          app/frontend/javascript/shared/resources.js on lines 97..109
          app/frontend/javascript/shared/resources.js on lines 110..122
          app/frontend/javascript/shared/resources.js on lines 123..135
          app/frontend/javascript/shared/resources.js on lines 136..148
          app/frontend/javascript/shared/resources.js on lines 149..161
          app/frontend/javascript/shared/resources.js on lines 191..203
          app/frontend/javascript/shared/resources.js on lines 204..216
          app/frontend/javascript/shared/resources.js on lines 217..229
          app/frontend/javascript/shared/resources.js on lines 243..255
          app/frontend/javascript/shared/resources.js on lines 951..963

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

          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

          const exampleParentUsedOligos = {
            1: {
              'AAAAAAAT:GGGGGGGT': ['submission'],
              'TTTTTTTA:CCCCCCCA': ['submission'],
              'AAAAAAAC:GGGGGGGC': ['submission'],
          app/frontend/javascript/custom-tagged-plate/testData/customTaggedPlateTestData.js on lines 714..722

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

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

            {
              "resource": "between_specific_tube",
              "attributes": {
                "uuid": "",
                "source_uuid": "",
          Severity: Major
          Found in app/frontend/javascript/shared/resources.js and 11 other locations - About 40 mins to fix
          app/frontend/javascript/shared/resources.js on lines 57..69
          app/frontend/javascript/shared/resources.js on lines 97..109
          app/frontend/javascript/shared/resources.js on lines 110..122
          app/frontend/javascript/shared/resources.js on lines 123..135
          app/frontend/javascript/shared/resources.js on lines 149..161
          app/frontend/javascript/shared/resources.js on lines 191..203
          app/frontend/javascript/shared/resources.js on lines 204..216
          app/frontend/javascript/shared/resources.js on lines 217..229
          app/frontend/javascript/shared/resources.js on lines 230..242
          app/frontend/javascript/shared/resources.js on lines 243..255
          app/frontend/javascript/shared/resources.js on lines 951..963

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

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

            {
              "resource": "asset_audit",
              "attributes": {
                "key": "",
                "message": "",
          Severity: Major
          Found in app/frontend/javascript/shared/resources.js and 11 other locations - About 40 mins to fix
          app/frontend/javascript/shared/resources.js on lines 97..109
          app/frontend/javascript/shared/resources.js on lines 110..122
          app/frontend/javascript/shared/resources.js on lines 123..135
          app/frontend/javascript/shared/resources.js on lines 136..148
          app/frontend/javascript/shared/resources.js on lines 149..161
          app/frontend/javascript/shared/resources.js on lines 191..203
          app/frontend/javascript/shared/resources.js on lines 204..216
          app/frontend/javascript/shared/resources.js on lines 217..229
          app/frontend/javascript/shared/resources.js on lines 230..242
          app/frontend/javascript/shared/resources.js on lines 243..255
          app/frontend/javascript/shared/resources.js on lines 951..963

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

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

            {
              "resource": "from_plate_to_specific_tube",
              "attributes": {
                "uuid": "",
                "source_uuid": "",
          Severity: Major
          Found in app/frontend/javascript/shared/resources.js and 11 other locations - About 40 mins to fix
          app/frontend/javascript/shared/resources.js on lines 57..69
          app/frontend/javascript/shared/resources.js on lines 97..109
          app/frontend/javascript/shared/resources.js on lines 110..122
          app/frontend/javascript/shared/resources.js on lines 123..135
          app/frontend/javascript/shared/resources.js on lines 136..148
          app/frontend/javascript/shared/resources.js on lines 149..161
          app/frontend/javascript/shared/resources.js on lines 204..216
          app/frontend/javascript/shared/resources.js on lines 217..229
          app/frontend/javascript/shared/resources.js on lines 230..242
          app/frontend/javascript/shared/resources.js on lines 243..255
          app/frontend/javascript/shared/resources.js on lines 951..963

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

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

            {
              "resource": "from_plate_to_tube",
              "attributes": {
                "uuid": "",
                "source_uuid": "",
          Severity: Major
          Found in app/frontend/javascript/shared/resources.js and 11 other locations - About 40 mins to fix
          app/frontend/javascript/shared/resources.js on lines 57..69
          app/frontend/javascript/shared/resources.js on lines 97..109
          app/frontend/javascript/shared/resources.js on lines 110..122
          app/frontend/javascript/shared/resources.js on lines 123..135
          app/frontend/javascript/shared/resources.js on lines 136..148
          app/frontend/javascript/shared/resources.js on lines 149..161
          app/frontend/javascript/shared/resources.js on lines 191..203
          app/frontend/javascript/shared/resources.js on lines 204..216
          app/frontend/javascript/shared/resources.js on lines 217..229
          app/frontend/javascript/shared/resources.js on lines 230..242
          app/frontend/javascript/shared/resources.js on lines 951..963

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

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

            {
              "resource": "transfer",
              "attributes": {
                "uuid": "",
                "source_uuid": "",
          Severity: Major
          Found in app/frontend/javascript/shared/resources.js and 11 other locations - About 40 mins to fix
          app/frontend/javascript/shared/resources.js on lines 57..69
          app/frontend/javascript/shared/resources.js on lines 97..109
          app/frontend/javascript/shared/resources.js on lines 110..122
          app/frontend/javascript/shared/resources.js on lines 123..135
          app/frontend/javascript/shared/resources.js on lines 136..148
          app/frontend/javascript/shared/resources.js on lines 149..161
          app/frontend/javascript/shared/resources.js on lines 191..203
          app/frontend/javascript/shared/resources.js on lines 204..216
          app/frontend/javascript/shared/resources.js on lines 217..229
          app/frontend/javascript/shared/resources.js on lines 230..242
          app/frontend/javascript/shared/resources.js on lines 243..255

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

          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