little-bobby-tables/elasticfusion

View on GitHub
lib/elasticfusion/search/builder.rb

Summary

Maintainability
A
0 mins
Test Coverage

%w-literals should be delimited by [ and ].
Open

        raise Search::InvalidSortOrderError if %w(desc asc).exclude? direction.to_s
Severity: Minor
Found in lib/elasticfusion/search/builder.rb by rubocop

This cop enforces the consistent usage of %-literal delimiters.

Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.

Example:

# Style/PercentLiteralDelimiters:
#   PreferredDelimiters:
#     default: '[]'
#     '%i':    '()'

# good
%w[alpha beta] + %i(gamma delta)

# bad
%W(alpha #{beta})

# bad
%I(alpha beta)

Use attr_reader to define trivial reader methods.
Open

      def filters
Severity: Minor
Found in lib/elasticfusion/search/builder.rb by rubocop

This cop looks for trivial reader/writer methods, that could have been created with the attr_* family of functions automatically.

Example:

# bad
def foo
  @foo
end

def bar=(val)
  @bar = val
end

def self.baz
  @baz
end

# good
attr_reader :foo
attr_writer :bar

class << self
  attr_reader :baz
end

Add an empty line after magic comments.
Open

module Elasticfusion
Severity: Minor
Found in lib/elasticfusion/search/builder.rb by rubocop

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

There are no issues that match your filters.

Category
Status