twitter/twitter-cldr-rb

View on GitHub
lib/twitter_cldr/shared/properties_database.rb

Summary

Maintainability
A
2 hrs
Test Coverage

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

      def lookup_code_point(code_point)
        {}.tap do |properties|
          each_property_pair do |property_name, property_value|
            code_points = code_points_for_property(
              property_name, property_value
Severity: Minor
Found in lib/twitter_cldr/shared/properties_database.rb - About 55 mins to fix

Cognitive Complexity

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

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

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

Further reading

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

      def property_values_for(property_name)
        if property_values.include?(property_name)
          return property_values[property_name]
        end

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_property_pair has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def each_property_pair
        if block_given?
          property_names.each do |property_name|
            if property_values = property_values_for(property_name)
              property_values.each do |property_value|
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 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

There are no issues that match your filters.

Category
Status