twitter/twitter-cldr-rb

View on GitHub

Showing 209 of 209 total issues

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

      def remove_illegal_hyphens(break_weights, text)
        break_weights.map.with_index do |break_weight, idx|
          next break_weight if idx.zero?
          next 0 if no_hyphen.include?(text[idx - 1])
          break_weight
Severity: Minor
Found in lib/twitter_cldr/shared/hyphenator.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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def initialize(language, script = nil, region = nil, variants = [])
        @language = language ? language.to_s : nil
        @script = script ? script.to_s : nil
        @region = region ? region.to_s : nil
        @variants = Array(variants)
Severity: Minor
Found in lib/twitter_cldr/shared/locale.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 code_points_for_property has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def code_points_for_property(property_name, property_value = nil)
        key = key_for(property_name, property_value)
        node = trie.get_node(key)

        if node
Severity: Minor
Found in lib/twitter_cldr/shared/properties_database.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 each_boundary has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def each_boundary(cursor, stop = cursor.length)
        return to_enum(__method__, cursor, stop) unless block_given?

        until cursor.position >= stop || cursor.eos?
          state_machine.handle_next(cursor)
Severity: Minor
Found in lib/twitter_cldr/segmentation/rule_set.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 encode_trie has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def encode_trie(trie)
        arr = [].tap do |results|
          iter = trie.iterator

          while iter.hasNext
Severity: Minor
Found in lib/twitter_cldr/resources/segment_rules_importer.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 boundary_split has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def boundary_split(text_sample, boundaries)
        eos = text_sample.size

        boundaries = [*boundaries]
        boundaries.unshift(0) unless boundaries.first == 0
Severity: Minor
Found in lib/twitter_cldr/resources/segment_tests_importer.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 process_plurals has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def process_plurals(component, locale, path)
        return unless component == 'PluralRules'

        output_file = File.join(File.dirname(path), 'plurals.yml')

Severity: Minor
Found in lib/twitter_cldr/resources/locales_resources_importer.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 round_to has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def round_to(number, precision, rounding = 0)
        factor = 10 ** precision
        result = number.is_a?(BigDecimal) ?
          ((number * factor).fix / factor) :
          ((number * factor).round.to_f / factor)
Severity: Minor
Found in lib/twitter_cldr/formatters/numbers/number_formatter.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 contexts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def contexts(kind, options = {})
        return {} unless calendar

        dtd.find_attr("#{kind}Context", 'type').values.each_with_object({}) do |context, result|
          node = calendar.xpath("#{kind}s/#{kind}Context[@type='#{context}']").first
Severity: Minor
Found in lib/twitter_cldr/resources/calendars_importer.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 reset_locale_fallbacks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def reset_locale_fallbacks
      locale_fallbacks.clear
      TwitterCldr.register_locale_fallback(lambda { I18n.locale if defined?(I18n) && I18n.respond_to?(:locale) })
      TwitterCldr.register_locale_fallback(lambda { FastGettext.locale if defined?(FastGettext) && FastGettext.respond_to?(:locale) })
    end
Severity: Minor
Found in lib/twitter_cldr.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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def initialize(collation_elements, options = {})
        raise ArgumentError, "second argument should be an options hash, not `#{options}`. Do you mean `:case_first => #{options}`?" unless options.kind_of? Hash

        case_first = options[:case_first]
        raise ArgumentError, "invalid case-first options '#{case_first.inspect}'" unless VALID_CASE_FIRST_OPTIONS.include?(case_first)
Severity: Minor
Found in lib/twitter_cldr/collation/sort_key_builder.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 build_bytes_array has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def build_bytes_array
        @bytes_array = []

        append_primary_bytes
        append_secondary_bytes unless @maximum_level && (@maximum_level < 2)
Severity: Minor
Found in lib/twitter_cldr/collation/sort_key_builder.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 append_tertiary_byte has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def append_tertiary_byte(tertiary)
        if tertiary == @tertiary_common
          @common_count += 1
        else
          if @tertiary_common == TERTIARY_COMMON_NORMAL && @tertiary_common < tertiary
Severity: Minor
Found in lib/twitter_cldr/collation/sort_key_builder.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 12 locations. Consider refactoring.
Open

  module Resources
    module Properties

      class IndicSyllabicCategoryPropertyImporter < PropertyImporter
        DATA_FILE = 'ucd/IndicSyllabicCategory.txt'
lib/twitter_cldr/resources/properties/age_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/blocks_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/east_asian_width_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/grapheme_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/hangul_syllable_type_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/indic_positional_category_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/jamo_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/line_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/script_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/sentence_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/word_break_property_importer.rb on lines 7..25

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 12 locations. Consider refactoring.
Open

  module Resources
    module Properties

      class SentenceBreakPropertyImporter < PropertyImporter
        DATA_FILE = 'ucd/auxiliary/SentenceBreakProperty.txt'
lib/twitter_cldr/resources/properties/age_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/blocks_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/east_asian_width_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/grapheme_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/hangul_syllable_type_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/indic_positional_category_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/indic_syllabic_category_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/jamo_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/line_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/script_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/word_break_property_importer.rb on lines 7..25

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 12 locations. Consider refactoring.
Open

  module Resources
    module Properties

      class WordBreakPropertyImporter < PropertyImporter
        DATA_FILE = 'ucd/auxiliary/WordBreakProperty.txt'
lib/twitter_cldr/resources/properties/age_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/blocks_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/east_asian_width_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/grapheme_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/hangul_syllable_type_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/indic_positional_category_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/indic_syllabic_category_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/jamo_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/line_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/script_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/sentence_break_property_importer.rb on lines 7..25

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 12 locations. Consider refactoring.
Open

  module Resources
    module Properties

      class EastAsianWidthPropertyImporter < PropertyImporter
        DATA_FILE = 'ucd/EastAsianWidth.txt'
lib/twitter_cldr/resources/properties/age_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/blocks_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/grapheme_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/hangul_syllable_type_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/indic_positional_category_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/indic_syllabic_category_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/jamo_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/line_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/script_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/sentence_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/word_break_property_importer.rb on lines 7..25

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 12 locations. Consider refactoring.
Open

  module Resources
    module Properties

      class GraphemeBreakPropertyImporter < PropertyImporter
        DATA_FILE = 'ucd/auxiliary/GraphemeBreakProperty.txt'
lib/twitter_cldr/resources/properties/age_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/blocks_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/east_asian_width_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/hangul_syllable_type_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/indic_positional_category_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/indic_syllabic_category_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/jamo_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/line_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/script_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/sentence_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/word_break_property_importer.rb on lines 7..25

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 12 locations. Consider refactoring.
Open

  module Resources
    module Properties

      class IndicPositionalCategoryPropertyImporter < PropertyImporter
        DATA_FILE = 'ucd/IndicPositionalCategory.txt'
lib/twitter_cldr/resources/properties/age_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/blocks_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/east_asian_width_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/grapheme_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/hangul_syllable_type_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/indic_syllabic_category_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/jamo_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/line_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/script_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/sentence_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/word_break_property_importer.rb on lines 7..25

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 12 locations. Consider refactoring.
Open

  module Resources
    module Properties

      class JamoPropertyImporter < PropertyImporter
        DATA_FILE = 'ucd/Jamo.txt'
lib/twitter_cldr/resources/properties/age_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/blocks_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/east_asian_width_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/grapheme_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/hangul_syllable_type_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/indic_positional_category_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/indic_syllabic_category_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/line_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/script_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/sentence_break_property_importer.rb on lines 7..25
lib/twitter_cldr/resources/properties/word_break_property_importer.rb on lines 7..25

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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