emojidex/emojidex

View on GitHub
lib/emojidex/data/collection/cache.rb

Summary

Maintainability
B
4 hrs
Test Coverage

Method _raster_check_copy has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

      def _raster_check_copy(moji, format, sizes)
        sizes.each do |size|
          if @raster_source_path != nil
            src_d = "#{@raster_source_path}/#{size}/#{moji.code}"
            src = "#{src_d}.#{format}"
Severity: Minor
Found in lib/emojidex/data/collection/cache.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 setup_cache has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

      def setup_cache(path = nil)
        @formats = Emojidex::Defaults.selected_formats unless @formats
        @sizes = Emojidex::Defaults.selected_sizes unless @sizes
        @download_queue = []
        @download_threads = 4
Severity: Minor
Found in lib/emojidex/data/collection/cache.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 _svg_check_copy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

      def _svg_check_copy(moji)
        if @vector_source_path != nil
          src_d = "#{@vector_source_path}/#{moji.code}"
          src = "#{src_d}.svg"

Severity: Minor
Found in lib/emojidex/data/collection/cache.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 _cache has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def _cache(options)
        setup_cache options[:cache_path]
        formats = options[:formats] || @formats
        sizes = options[:sizes] || @sizes

Severity: Minor
Found in lib/emojidex/data/collection/cache.rb - About 35 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