Method has too many lines. [14/10] Open
def self.send_mail_to_assigned_reviewers(reviewer, participant, mapping)
Mailer.sync_message(
{
to: reviewer.email,
subject: "Assignment '#{participant.assignment.name}': A submission has been updated since you last reviewed it",
- 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.
Method has too many lines. [11/10] Open
def self.send_mail_for_conference_user(user, subject, partial_name, password, conference_variable)
Mailer.generic_message(
to: user.email,
subject: subject,
body: {
- 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.
Method send_mail_for_conference_user
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.send_mail_for_conference_user(user, subject, partial_name, password, conference_variable)
Missing top-level module documentation comment. Open
module MailerHelper
- 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
Redundant curly braces around a hash parameter. Open
{
to: reviewer.email,
subject: "Assignment '#{participant.assignment.name}': A submission has been updated since you last reviewed it",
cc: participant.assignment.instructor.email,
body: {
- Read upRead up
- Exclude checks
This cop checks for braces around the last parameter in a method call
if the last parameter is a hash.
It supports braces
, no_braces
and context_dependent
styles.
Example: EnforcedStyle: braces
# The `braces` style enforces braces around all method
# parameters that are hashes.
# bad
some_method(x, y, a: 1, b: 2)
# good
some_method(x, y, {a: 1, b: 2})
Example: EnforcedStyle: no_braces (default)
# The `no_braces` style checks that the last parameter doesn't
# have braces around it.
# bad
some_method(x, y, {a: 1, b: 2})
# good
some_method(x, y, a: 1, b: 2)
Example: EnforcedStyle: context_dependent
# The `context_dependent` style checks that the last parameter
# doesn't have braces around it, but requires braces if the
# second to last parameter is also a hash literal.
# bad
some_method(x, y, {a: 1, b: 2})
some_method(x, y, {a: 1, b: 2}, a: 1, b: 2)
# good
some_method(x, y, a: 1, b: 2)
some_method(x, y, {a: 1, b: 2}, {a: 1, b: 2})