tansaku/LocalSupport

View on GitHub
app/services/queries/organisations.rb

Summary

Maintainability
A
0 mins
Test Coverage

Method has too many lines. [10/5] (https://github.com/bbatsov/ruby-style-guide#short-methods)
Open

    def self.search_by_keyword_and_category(parsed_params)
      organisations = order_by_most_recent.search_by_keyword(
        parsed_params.query_term
      )

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.

Method has too many lines. [7/5] (https://github.com/bbatsov/ruby-style-guide#short-methods)
Open

    def self.add_recently_updated_and_has_owner(organisations)
      one_year_ago = Time.current.advance(years: -1)
      recently_updated = "organisations.updated_at > '#{one_year_ago.strftime(FORMAT)}'"
      has_owner = "organisations.id IN (SELECT users.organisation_id FROM users)"
      condition =

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.

Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://github.com/bbatsov/ruby-style-guide#consistent-string-literals)
Open

      has_owner = "organisations.id IN (SELECT users.organisation_id FROM users)"

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

There are no issues that match your filters.

Category
Status