Showing 3,213 of 3,213 total issues
Tab detected. Open
Open
@subject = Subject.new(subject_params)
- Exclude checks
Space inside parentheses detected. Open
Open
if ( is_principal? )
- Read upRead up
- Exclude checks
Checks for spaces inside ordinary round parentheses.
Example:
# bad
f( 3)
g = (a + 3 )
# good
f(3)
g = (a + 3)
Tab detected. Open
Open
@subject.save
- Exclude checks
Don't use parentheses around the condition of an if
. Open
Open
if (@teacher.save)
- Read upRead up
- Exclude checks
This cop checks for the presence of superfluous parentheses around the condition of if/unless/while/until.
Example:
# bad
x += 1 while (x < 10)
foo unless (bar || baz)
if (x > 10)
elsif (x < 3)
end
# good
x += 1 while x < 10
foo unless bar || baz
if x > 10
elsif x < 3
end
Inconsistent indentation detected. Open
Open
def new
if ( is_principal? )
@classroom_grades = ClassroomGrade.all
@subject = Subject.new
else
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Tab detected. Open
Open
flash[:success] = "Matéria criada com sucesso"
- Exclude checks
Inconsistent indentation detected. Open
Open
def subject_params
params.require(:subject).permit(:name_subject,
:class_level,:teacher_id,:classroom_id,:subject_id, :classroom_grade_id)
end
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Tab detected. Open
Open
end
- Exclude checks
Tab detected. Open
Open
end
- Exclude checks
Tab detected. Open
Open
@subject = Subject.find(params[:id])
- Exclude checks
Tab detected. Open
Open
end
- Exclude checks
Tab detected. Open
Open
else
- Exclude checks
Tab detected. Open
Open
end
- Exclude checks
Tab detected. Open
Open
end
- Exclude checks
Tab detected. Open
Open
@classroom_grades = ClassroomGrade.all
- Exclude checks
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
Open
redirect_to "/errors/error_500"
- 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"
Space inside parentheses detected. Open
Open
if ( @notification.update(notification_params) )
- Read upRead up
- Exclude checks
Checks for spaces inside ordinary round parentheses.
Example:
# bad
f( 3)
g = (a + 3 )
# good
f(3)
g = (a + 3)
Use a guard clause instead of wrapping the code inside a conditional expression. Open
Open
if ( logged_in? )
- Read upRead up
- Exclude checks
Use a guard clause instead of wrapping the code inside a conditional expression
Example:
# bad
def test
if something
work
end
end
# good
def test
return unless something
work
end
# also good
def test
work if something
end
# bad
if something
raise 'exception'
else
ok
end
# good
raise 'exception' if something
ok
Don't use parentheses around a method call. Open
Open
if ( is_employee? )
- Read upRead up
- Exclude checks
This cop checks for redundant parentheses.
Example:
# bad
(x) if ((y.z).nil?)
# good
x if y.z.nil?
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
Open
flash[:success] = "A notificação foi criada com sucesso."
- 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"