AgileVentures/LocalSupport

View on GitHub
lib/tasks/emails.rake

Summary

Maintainability
Test Coverage

Unused block argument - t. If it's necessary, use _ or _t as an argument name to indicate that it won't be used. (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)
Open

      task :emails, [:file] => :environment do |t, args|
Severity: Minor
Found in lib/tasks/emails.rake by rubocop

This cop checks for unused block arguments.

Example:

# bad

do_something do |used, unused|
  puts used
end

do_something do |bar|
  puts :foo
end

define_method(:foo) do |bar|
  puts :baz
end

Example:

#good

do_something do |used, _unused|
  puts used
end

do_something do
  puts :foo
end

define_method(:foo) do |_bar|
  puts :baz
end

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

        require File.expand_path("../../config/environment", File.dirname(__FILE__))
Severity: Minor
Found in lib/tasks/emails.rake by rubocop

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"

Line is too long. [100/90] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

        #this is needed because rake tasks load classes lazily; from the command line, the task will
Severity: Minor
Found in lib/tasks/emails.rake by rubocop

Line is too long. [104/90] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

          Organisation.import_emails(args[:file],1000).split("\n").each { |msg| Rails.logger.info(msg) }
Severity: Minor
Found in lib/tasks/emails.rake by rubocop

Line is too long. [91/90] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
Open

        #otherwise fail because it takes the below intended monkeypatch as first definition
Severity: Minor
Found in lib/tasks/emails.rake by rubocop

There are no issues that match your filters.

Category
Status