ayemos/lamma

View on GitHub
lib/lamma/code.rb

Summary

Maintainability
A
2 hrs
Test Coverage

Method prebuild has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def prebuild
      if @prebuild
        Lamma.logger.info 'Running prebuild script...'
        raise unless system(@prebuild)
      elsif [Lamma::Runtime::PYTHON_27, Lamma::Runtime::PYTHON_36].include?(@function.runtime.type) \
Severity: Minor
Found in lib/lamma/code.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 zip_and_save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def zip_and_save
      io = Zip::OutputStream.write_buffer do |zio|
        active_paths.each do |path|
          next unless File.file?(path)
          File.open(path) do |source_io|
Severity: Minor
Found in lib/lamma/code.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

XXX found
Open

      if true # XXX: option save_builds?
Severity: Minor
Found in lib/lamma/code.rb by fixme

TODO found
Open

      # TODO: impl
Severity: Minor
Found in lib/lamma/code.rb by fixme

unexpected token error (Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
Open

      raise Exception("Invalid source_path #{@source_path}") if @source_path&.empty?
Severity: Minor
Found in lib/lamma/code.rb by rubocop

There are no issues that match your filters.

Category
Status