twitter/twitter-cldr-rb

View on GitHub
lib/twitter_cldr/data_readers/number_data_reader.rb

Summary

Maintainability
A
1 hr
Test Coverage

Method traverse_finding_best_fit has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def traverse_finding_best_fit(path_pattern, path, hash = resource)
        if path_pattern.empty?
          result = traverse_following_aliases(path, hash)
          return result if result.is_a?(String)
        else
Severity: Minor
Found in lib/twitter_cldr/data_readers/number_data_reader.rb - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

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

      def pattern_for_sign(pattern, sign)
        if pattern.include?(";")
          positive, negative = pattern.split(";")
          sign == :positive ? positive : negative
        else
Severity: Minor
Found in lib/twitter_cldr/data_readers/number_data_reader.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

There are no issues that match your filters.

Category
Status