lib/extended_content_scope_helpers.rb
Method has too many lines. [13/10] Open
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
- Read upRead up
- Exclude checks
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
Open
look_for_xml = xml.to_xml.lines.collect { |l| l.chomp }[1].downcase
- Read upRead up
- Exclude checks
Use symbols as procs when possible.
Example:
# bad
something.map { |s| s.upcase }
# good
something.map(&:upcase)