fga-gpp-mds/2017.1-Escola-X

View on GitHub

Showing 3,213 of 3,213 total issues

Tab detected.
Open

            @subject = Subject.new(subject_params)

Space inside parentheses detected.
Open

    if ( is_principal? )

Checks for spaces inside ordinary round parentheses.

Example:

# bad
f( 3)
g = (a + 3 )

# good
f(3)
g = (a + 3)

Tab detected.
Open

                @subject.save

Don't use parentheses around the condition of an if.
Open

      if (@teacher.save)

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

  def new
      if ( is_principal? )
            @classroom_grades = ClassroomGrade.all
          @subject = Subject.new
    else

This cops checks for inconsistent indentation.

Example:

class A
  def test
    puts 'hello'
     puts 'world'
  end
end

Tab detected.
Open

                    flash[:success] = "Matéria criada com sucesso"

Inconsistent indentation detected.
Open

  def subject_params
      params.require(:subject).permit(:name_subject,
        :class_level,:teacher_id,:classroom_id,:subject_id, :classroom_grade_id)
  end

This cops checks for inconsistent indentation.

Example:

class A
  def test
    puts 'hello'
     puts 'world'
  end
end

Tab detected.
Open

      end

Tab detected.
Open

        end

Tab detected.
Open

          @subject = Subject.find(params[:id])

Tab detected.
Open

            end

Tab detected.
Open

            else

Tab detected.
Open

        end

Tab detected.
Open

            end

Tab detected.
Open

            @classroom_grades = ClassroomGrade.all

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

              redirect_to "/errors/error_500"

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

      if ( @notification.update(notification_params) )

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

    if ( logged_in? )

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

    if ( is_employee? )

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

        flash[:success] = "A notificação foi criada com sucesso."

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"
Severity
Category
Status
Source
Language