ignitionworks/draftjs_exporter

View on GitHub
lib/draftjs_exporter/entity_state.rb

Summary

Maintainability
A
0 mins
Test Coverage

Add an empty line after magic comments.
Open

require 'draftjs_exporter/entities/null'

Checks for a newline after the final magic comment.

Example:

# good
# frozen_string_literal: true

# Some documentation for Person
class Person
  # Some code
end

# bad
# frozen_string_literal: true
# Some documentation for Person
class Person
  # Some code
end

Shadowing outer local variable - key.
Open

      entity_keys.map { |key| entity_map.fetch(key, nil) }.compact.first

This cop looks for use of the same name as outer local variables for block arguments or block local variables. This is a mimic of the warning "shadowing outer local variable - foo" from ruby -cw.

Example:

# bad

def some_method
  foo = 1

  2.times do |foo| # shadowing outer `foo`
    do_something(foo)
  end
end

Example:

# good

def some_method
  foo = 1

  2.times do |bar|
    do_something(bar)
  end
end

There are no issues that match your filters.

Category
Status