18F/dolores-landingham-slack-bot

View on GitHub
app/controllers/employees_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Open

    flash[:notice] = I18n.t('controllers.employees_controller.notices.destroy', slack_username: @employee.slack_username)

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"

Line is too long. [90/80]
Open

      @employees = Employee.filter(params).order(slack_username: :asc).page(params[:page])

Line is too long. [81/80]
Open

    if @employee.errors.full_messages.empty? && @employee.update(employee_params)

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Open

      flash[:notice] = I18n.t('controllers.employees_controller.notices.create', slack_username: @employee.slack_username)

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"

Extra blank line detected.
Open


    if @employee.errors.full_messages.empty? && @employee.update(employee_params)

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Line is too long. [121/80]
Open

    flash[:notice] = I18n.t('controllers.employees_controller.notices.destroy', slack_username: @employee.slack_username)

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Open

      flash[:notice] = I18n.t('controllers.employees_controller.notices.update')

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"

Line is too long. [122/80]
Open

      flash[:notice] = I18n.t('controllers.employees_controller.notices.create', slack_username: @employee.slack_username)

There are no issues that match your filters.

Category
Status