app/services/mailer.rb
Method send_generic_email
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def self.send_generic_email(hide_recipients, recipients, reply_to, subject, content)
Line is too long. [86/80] Open
Open
def self.send_generic_email(hide_recipients, recipients, reply_to, subject, content)
- Exclude checks
Line is too long. [137/80] Open
Open
# @param hide_recipients - a boolean. `true` will send an email to the recipients one by one, `false` will send an email to all at once
- Exclude checks
Line is too long. [125/80] Open
Open
# @param recipients [Array<String>] - email addresses of recipients - can be a string of comma separated email adresses too
- Exclude checks
Line is too long. [84/80] Open
Open
# @return [ActionMailer::MessageDelivery] a mail object with the given parameters.
- Exclude checks
Missing top-level class documentation comment. Open
Open
class Mailer
- Read upRead up
- Exclude checks
This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.
The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.
Example:
# bad
class Person
# ...
end
# good
# Description/Explanation of Person class
class Person
# ...
end
Line is too long. [85/80] Open
Open
PortalMailer.generic_email(recipient, reply_to, subject, content).deliver_now
- Exclude checks
Extra empty line detected at class body beginning. Open
Open
# @param hide_recipients - a boolean. `true` will send an email to the recipients one by one, `false` will send an email to all at once
- Read upRead up
- Exclude checks
This cops checks if empty lines around the bodies of classes match the configuration.
Example: EnforcedStyle: empty_lines
# good
class Foo
def bar
# ...
end
end
Example: EnforcedStyle: emptylinesexcept_namespace
# good
class Foo
class Bar
# ...
end
end
Example: EnforcedStyle: emptylinesspecial
# good
class Foo
def bar; end
end
Example: EnforcedStyle: noemptylines (default)
# good
class Foo
def bar
# ...
end
end
Line is too long. [136/80] Open
Open
# @param reply_to [Array<String>] - email addresses of recipient of the answer - can be a string of comma separated email adresses too
- Exclude checks
Favor modifier if
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
. Open
Open
if recipients.is_a? String
- Read upRead up
- Exclude checks
Checks for if and unless statements that would fit on one line
if written as a modifier if/unless. The maximum line length is
configured in the Metrics/LineLength
cop.
Example:
# bad
if condition
do_stuff(bar)
end
unless qux.empty?
Foo.do_something
end
# good
do_stuff(bar) if condition
Foo.do_something unless qux.empty?
Line is too long. [84/80] Open
Open
PortalMailer.generic_email(recipients, reply_to, subject, content).deliver_now
- Exclude checks