Assignment Branch Condition size for create is too high. [24.92/15] Open
def create
event_id = params[:event_id]
@agreement_letter = AgreementLetter.where(user: current_user, event_id: event_id).take
if @agreement_letter.nil?
@agreement_letter = AgreementLetter.new
- 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. [16/10] Open
def create
event_id = params[:event_id]
@agreement_letter = AgreementLetter.where(user: current_user, event_id: event_id).take
if @agreement_letter.nil?
@agreement_letter = AgreementLetter.new
- 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.
Line is too long. [90/80] Open
@agreement_letter = AgreementLetter.where(user: current_user, event_id: event_id).take
- Exclude checks
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
notice: t("agreement_letters.upload_success")
- Read upRead up
- Exclude checks
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"
Missing top-level class documentation comment. Open
class AgreementLettersController < ApplicationController
- 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