lib/external_search_sources.rb

Summary

Maintainability
A
0 mins
Test Coverage

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

ExternalSearchSources[:source_targets] = %w{search homepage}
Severity: Minor
Found in lib/external_search_sources.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)

Avoid single-line method definitions.
Open

  def self.settings;        @@settings;              end
Severity: Minor
Found in lib/external_search_sources.rb by rubocop

This cop checks for single-line method definitions that contain a body. It will accept single-line methods with no body.

Example:

# bad
def some_method; body end
def link_to(url); {:name => url}; end
def @table.columns; super; end

# good
def no_op; end
def self.resource_class=(klass); end
def @table.columns; end

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

ExternalSearchSources[:source_types] = %w{feed}
Severity: Minor
Found in lib/external_search_sources.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)

Replace class var @@settings with a class instance var.
Open

  @@settings = {}
Severity: Minor
Found in lib/external_search_sources.rb by rubocop

This cop checks for uses of class variables. Offenses are signaled only on assignment to class variables to reduce the number of offenses that would be reported.

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

ExternalSearchSources[:limit_params] = %w{count limit num_results}
Severity: Minor
Found in lib/external_search_sources.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)

Avoid single-line method definitions.
Open

  def self.[](key);         @@settings[key];         end
Severity: Minor
Found in lib/external_search_sources.rb by rubocop

This cop checks for single-line method definitions that contain a body. It will accept single-line methods with no body.

Example:

# bad
def some_method; body end
def link_to(url); {:name => url}; end
def @table.columns; super; end

# good
def no_op; end
def self.resource_class=(klass); end
def @table.columns; end

Avoid single-line method definitions.
Open

  def self.[]=(key, value); @@settings[key] = value; end
Severity: Minor
Found in lib/external_search_sources.rb by rubocop

This cop checks for single-line method definitions that contain a body. It will accept single-line methods with no body.

Example:

# bad
def some_method; body end
def link_to(url); {:name => url}; end
def @table.columns; super; end

# good
def no_op; end
def self.resource_class=(klass); end
def @table.columns; end

There are no issues that match your filters.

Category
Status