lib/extended_content_scope_helpers.rb

Summary

Maintainability
A
0 mins
Test Coverage

Method has too many lines. [13/10]
Open

  def field_condition_sql_for(pattern, field_id, exact_match = false)
    field = ExtendedField.find(field_id)
    xml = Nokogiri::XML::Builder.new

    pattern = "#{pattern}%" unless exact_match

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Pass &:chomp as an argument to collect instead of a block.
Open

    look_for_xml = xml.to_xml.lines.collect { |l| l.chomp }[1].downcase

Use symbols as procs when possible.

Example:

# bad
something.map { |s| s.upcase }

# good
something.map(&:upcase)

There are no issues that match your filters.

Category
Status