lulibrary/puree

View on GitHub

Showing 44 of 44 total issues

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

      def temporal_range(start_path, end_path)
        range_start = xpath_query_for_single_value start_path
        range_end = xpath_query_for_single_value end_path
        if range_start || range_end
          range = Puree::Model::TemporalRange.new
Severity: Minor
Found in lib/puree/xml_extractor/project.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

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

      def projects
        xpath_result = xpath_query '/relatedProjects/relatedProject'
        data_arr = []
        xpath_result.each { |i|
          related = Puree::Model::RelatedContentHeader.new
Severity: Minor
Found in lib/puree/xml_extractor/mixins/project_mixin.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

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

      def other_names
        xpath_result = xpath_query '/nameVariants/nameVariant/name'
        data = []
        xpath_result.each do |d|
          first = xpath_result.xpath('firstName').text.strip
Severity: Minor
Found in lib/puree/xml_extractor/person.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

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

      def self.organisation_header(nokogiri_xml_element)
        h = Puree::Model::OrganisationalUnitHeader.new
        h.uuid = nokogiri_xml_element.xpath('@uuid').text.strip
        xpath_result_name = nokogiri_xml_element.xpath('name/text')
        h.name = xpath_result_name.first.text.strip unless xpath_result_name.empty?
Severity: Minor
Found in lib/puree/xml_extractor/shared.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

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

      def event
        xpath_result = xpath_query '/event'
        if !xpath_result.empty?
          header = Puree::Model::EventHeader.new
          header.uuid = xpath_result.xpath('@uuid').text.strip
Severity: Minor
Found in lib/puree/xml_extractor/mixins/event_mixin.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

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

      def research_outputs
        xpath_result = xpath_query '/relatedResearchOutputs/relatedResearchOutput'
        data_arr = []
        xpath_result.each { |i|
          related = Puree::Model::RelatedContentHeader.new
Severity: Minor
Found in lib/puree/xml_extractor/mixins/research_output_mixin.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

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

      def temporal_range(start_path, end_path)
        range_start = Puree::Util::Date.hash_to_time temporal_date(start_path)
        range_end = Puree::Util::Date.hash_to_time temporal_date(end_path)
        if range_start || range_end
          range = Puree::Model::TemporalRange.new
Severity: Minor
Found in lib/puree/xml_extractor/dataset.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

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

      def self.external_organisation_header(nokogiri_xml_element)
        h = Puree::Model::ExternalOrganisationHeader.new
        h.uuid = nokogiri_xml_element.xpath('@uuid').text.strip
        xpath_result_name = nokogiri_xml_element.xpath('name/text')
        h.name = xpath_result_name.first.text.strip unless xpath_result_name.empty?
Severity: Minor
Found in lib/puree/xml_extractor/shared.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

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

      def publisher
        xpath_result = xpath_query '/publisher'
        h = Puree::Model::PublisherHeader.new
        h.uuid = xpath_result.xpath('@uuid').text.strip
        xpath_result_name = xpath_result.xpath('name/text')
Severity: Minor
Found in lib/puree/xml_extractor/mixins/publisher_mixin.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 8 locations. Consider refactoring.
Open

  module Extractor

    # Dataset extractor.
    #
    class Dataset < Puree::Extractor::Resource
Severity: Major
Found in lib/puree/extractor/dataset.rb and 7 other locations - About 25 mins to fix
lib/puree/extractor/event.rb on lines 3..31
lib/puree/extractor/external_organisation.rb on lines 3..31
lib/puree/extractor/journal.rb on lines 3..31
lib/puree/extractor/organisational_unit.rb on lines 3..31
lib/puree/extractor/person.rb on lines 3..31
lib/puree/extractor/project.rb on lines 3..31
lib/puree/extractor/publisher.rb on lines 3..31

Duplicated Code

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

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

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

Tuning

This issue has a mass of 29.

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

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

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

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

Refactorings

Further Reading

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

  module Model

    # A legal condition.
    #
    class LegalCondition < Puree::Model::Structure
Severity: Minor
Found in lib/puree/model/legal_condition.rb and 4 other locations - About 25 mins to fix
lib/puree/model/copyright_license.rb on lines 2..22
lib/puree/model/event_header.rb on lines 2..22
lib/puree/model/identifier.rb on lines 2..22
lib/puree/model/link.rb on lines 2..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 29.

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

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

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

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

Refactorings

Further Reading

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

  module Extractor

    # Organisational unit extractor.
    #
    class OrganisationalUnit < Puree::Extractor::Resource
Severity: Major
Found in lib/puree/extractor/organisational_unit.rb and 7 other locations - About 25 mins to fix
lib/puree/extractor/dataset.rb on lines 3..31
lib/puree/extractor/event.rb on lines 3..31
lib/puree/extractor/external_organisation.rb on lines 3..31
lib/puree/extractor/journal.rb on lines 3..31
lib/puree/extractor/person.rb on lines 3..31
lib/puree/extractor/project.rb on lines 3..31
lib/puree/extractor/publisher.rb on lines 3..31

Duplicated Code

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

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

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

Tuning

This issue has a mass of 29.

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

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

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

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

Refactorings

Further Reading

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

  module Model

    # URL which points to something of interest.
    #
    class Link < Puree::Model::Structure
Severity: Minor
Found in lib/puree/model/link.rb and 4 other locations - About 25 mins to fix
lib/puree/model/copyright_license.rb on lines 2..22
lib/puree/model/event_header.rb on lines 2..22
lib/puree/model/identifier.rb on lines 2..22
lib/puree/model/legal_condition.rb on lines 2..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 29.

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

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

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

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

Refactorings

Further Reading

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

  module Extractor

    # Event extractor.
    #
    class Event < Puree::Extractor::Resource
Severity: Major
Found in lib/puree/extractor/event.rb and 7 other locations - About 25 mins to fix
lib/puree/extractor/dataset.rb on lines 3..31
lib/puree/extractor/external_organisation.rb on lines 3..31
lib/puree/extractor/journal.rb on lines 3..31
lib/puree/extractor/organisational_unit.rb on lines 3..31
lib/puree/extractor/person.rb on lines 3..31
lib/puree/extractor/project.rb on lines 3..31
lib/puree/extractor/publisher.rb on lines 3..31

Duplicated Code

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

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

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

Tuning

This issue has a mass of 29.

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

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

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

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

Refactorings

Further Reading

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

  module Extractor

    # Person extractor.
    #
    class Person < Puree::Extractor::Resource
Severity: Major
Found in lib/puree/extractor/person.rb and 7 other locations - About 25 mins to fix
lib/puree/extractor/dataset.rb on lines 3..31
lib/puree/extractor/event.rb on lines 3..31
lib/puree/extractor/external_organisation.rb on lines 3..31
lib/puree/extractor/journal.rb on lines 3..31
lib/puree/extractor/organisational_unit.rb on lines 3..31
lib/puree/extractor/project.rb on lines 3..31
lib/puree/extractor/publisher.rb on lines 3..31

Duplicated Code

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

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

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

Tuning

This issue has a mass of 29.

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

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

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

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

Refactorings

Further Reading

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

  module Extractor

    # External organisation extractor.
    #
    class ExternalOrganisation < Puree::Extractor::Resource
Severity: Major
Found in lib/puree/extractor/external_organisation.rb and 7 other locations - About 25 mins to fix
lib/puree/extractor/dataset.rb on lines 3..31
lib/puree/extractor/event.rb on lines 3..31
lib/puree/extractor/journal.rb on lines 3..31
lib/puree/extractor/organisational_unit.rb on lines 3..31
lib/puree/extractor/person.rb on lines 3..31
lib/puree/extractor/project.rb on lines 3..31
lib/puree/extractor/publisher.rb on lines 3..31

Duplicated Code

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

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

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

Tuning

This issue has a mass of 29.

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

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

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

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

Refactorings

Further Reading

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

  module Extractor

    # Publisher extractor.
    #
    class Publisher < Puree::Extractor::Resource
Severity: Major
Found in lib/puree/extractor/publisher.rb and 7 other locations - About 25 mins to fix
lib/puree/extractor/dataset.rb on lines 3..31
lib/puree/extractor/event.rb on lines 3..31
lib/puree/extractor/external_organisation.rb on lines 3..31
lib/puree/extractor/journal.rb on lines 3..31
lib/puree/extractor/organisational_unit.rb on lines 3..31
lib/puree/extractor/person.rb on lines 3..31
lib/puree/extractor/project.rb on lines 3..31

Duplicated Code

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

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

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

Tuning

This issue has a mass of 29.

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

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

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

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

Refactorings

Further Reading

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

  module Model

    # A minimal representation of an Event.
    #
    class EventHeader < Puree::Model::Structure
Severity: Minor
Found in lib/puree/model/event_header.rb and 4 other locations - About 25 mins to fix
lib/puree/model/copyright_license.rb on lines 2..22
lib/puree/model/identifier.rb on lines 2..22
lib/puree/model/legal_condition.rb on lines 2..22
lib/puree/model/link.rb on lines 2..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 29.

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

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

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

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

Refactorings

Further Reading

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

  module Model

    # An identifier.
    #
    class Identifier < Puree::Model::Structure
Severity: Minor
Found in lib/puree/model/identifier.rb and 4 other locations - About 25 mins to fix
lib/puree/model/copyright_license.rb on lines 2..22
lib/puree/model/event_header.rb on lines 2..22
lib/puree/model/legal_condition.rb on lines 2..22
lib/puree/model/link.rb on lines 2..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 29.

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

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

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

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

Refactorings

Further Reading

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

  module Model

    # A copyright license.
    #
    class CopyrightLicense < Puree::Model::Structure
Severity: Minor
Found in lib/puree/model/copyright_license.rb and 4 other locations - About 25 mins to fix
lib/puree/model/event_header.rb on lines 2..22
lib/puree/model/identifier.rb on lines 2..22
lib/puree/model/legal_condition.rb on lines 2..22
lib/puree/model/link.rb on lines 2..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 29.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language