Class has too many lines. [103/100] Open
class Mailer < ActionMailer::Base
if Rails.env.development? || Rails.env.test?
default from: 'expertiza.mailer@gmail.com'
else
default from: 'expertiza.mailer@gmail.com'
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for generic_message is too high. [25.71/15] Open
def generic_message(defn)
@partial_name = defn[:body][:partial_name]
@user = defn[:body][:user]
@first_name = defn[:body][:first_name]
@password = defn[:body][:password]
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for request_user_message is too high. [21.28/15] Open
def request_user_message(defn)
@user = defn[:body][:user]
@super_user = defn[:body][:super_user]
@first_name = defn[:body][:first_name]
@new_pct = defn[:body][:new_pct]
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for sync_message is too high. [19.42/15] Open
def sync_message(defn)
@body = defn[:body]
@type = defn[:body][:type]
@obj_name = defn[:body][:obj_name]
@link = defn[:body][:link]
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [14/10] Open
def generic_message(defn)
@partial_name = defn[:body][:partial_name]
@user = defn[:body][:user]
@first_name = defn[:body][:first_name]
@password = defn[:body][:password]
- 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. [14/10] Open
def notify_grade_conflict_message(defn)
@body = defn[:body]
@assignment = @body[:assignment]
@reviewer_name = @body[:reviewer_name]
- 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.
Assignment Branch Condition size for notify_grade_conflict_message is too high. [18.97/15] Open
def notify_grade_conflict_message(defn)
@body = defn[:body]
@assignment = @body[:assignment]
@reviewer_name = @body[:reviewer_name]
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [12/10] Open
def request_user_message(defn)
@user = defn[:body][:user]
@super_user = defn[:body][:super_user]
@first_name = defn[:body][:first_name]
@new_pct = defn[:body][:new_pct]
- 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 sync_message(defn)
@body = defn[:body]
@type = defn[:body][:type]
@obj_name = defn[:body][:obj_name]
@link = defn[:body][:link]
- 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.
Move default from: 'expertiza.mailer@gmail.com'
out of the conditional. Open
default from: 'expertiza.mailer@gmail.com'
- Read upRead up
- Exclude checks
This cop checks for identical lines at the beginning or end of each branch of a conditional statement.
Example:
# bad
if condition
do_x
do_z
else
do_y
do_z
end
# good
if condition
do_x
else
do_y
end
do_z
# bad
if condition
do_z
do_x
else
do_z
do_y
end
# good
do_z
if condition
do_x
else
do_y
end
# bad
case foo
when 1
do_x
when 2
do_x
else
do_x
end
# good
case foo
when 1
do_x
do_y
when 2
# nothing
else
do_x
do_z
end
Missing top-level class documentation comment. Open
class Mailer < ActionMailer::Base
- 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
Move default from: 'expertiza.mailer@gmail.com'
out of the conditional. Open
default from: 'expertiza.mailer@gmail.com'
- Read upRead up
- Exclude checks
This cop checks for identical lines at the beginning or end of each branch of a conditional statement.
Example:
# bad
if condition
do_x
do_z
else
do_y
do_z
end
# good
if condition
do_x
else
do_y
end
do_z
# bad
if condition
do_z
do_x
else
do_z
do_y
end
# good
do_z
if condition
do_x
else
do_y
end
# bad
case foo
when 1
do_x
when 2
do_x
else
do_x
end
# good
case foo
when 1
do_x
do_y
when 2
# nothing
else
do_x
do_z
end