fga-gpp-mds/2017.1-Escola-X

View on GitHub
app/models/subject.rb

Summary

Maintainability
A
0 mins
Test Coverage

Showing 31 of 31 total issues

Subject has no descriptive comment
Open

class Subject < ApplicationRecord
Severity: Minor
Found in app/models/subject.rb by reek

Align the elements of a hash literal if they span more than one line.
Open

maximum: 20,
Severity: Minor
Found in app/models/subject.rb by rubocop

Tab detected.
Open

has_many :classrooms, through: :classroom_subjects
Severity: Minor
Found in app/models/subject.rb by rubocop

Extra empty line detected at class body end.
Open

 
end
Severity: Minor
Found in app/models/subject.rb by rubocop

Tab detected.
Open

length: { minimum: 5,
Severity: Minor
Found in app/models/subject.rb by rubocop

Tab detected.
Open

:too_long => "deve possuir no máximo 20 caracteres."}
Severity: Minor
Found in app/models/subject.rb by rubocop

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

presence: { message: "não válido para criar matéria!" },
Severity: Minor
Found in app/models/subject.rb by rubocop

Missing top-level class documentation comment.
Open

class Subject < ApplicationRecord
Severity: Minor
Found in app/models/subject.rb by rubocop

Tab detected.
Open

validates_associated :alumns
Severity: Minor
Found in app/models/subject.rb by rubocop

Align the elements of a hash literal if they span more than one line.
Open

:too_short => "deve possuir mais de 5 caracteres.",
Severity: Minor
Found in app/models/subject.rb by rubocop

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

:too_long => "deve possuir no máximo 20 caracteres."}
Severity: Minor
Found in app/models/subject.rb by rubocop

Inconsistent indentation detected.
Open

validates :name_subject,
presence: { message: "Não pode estar em branco!" },
length: { minimum: 5,
maximum: 20,
:too_short => "deve possuir mais de 5 caracteres.",
Severity: Minor
Found in app/models/subject.rb by rubocop

Tab detected.
Open

has_many :alumns, through: :grades
Severity: Minor
Found in app/models/subject.rb by rubocop

Extra blank line detected.
Open

 
validates :teacher,
Severity: Minor
Found in app/models/subject.rb by rubocop

Tab detected.
Open

has_many :classroom_subjects, dependent: :destroy
Severity: Minor
Found in app/models/subject.rb by rubocop

Tab detected.
Open

validates_associated :grades
Severity: Minor
Found in app/models/subject.rb by rubocop

Use the new Ruby 1.9 hash syntax.
Open

:too_long => "deve possuir no máximo 20 caracteres."}
Severity: Minor
Found in app/models/subject.rb by rubocop

Tab detected.
Open

has_many :grades, dependent: :destroy
Severity: Minor
Found in app/models/subject.rb by rubocop

Tab detected.
Open

belongs_to :classroom_grade
Severity: Minor
Found in app/models/subject.rb by rubocop

Tab detected.
Open

:too_short => "deve possuir mais de 5 caracteres.",
Severity: Minor
Found in app/models/subject.rb by rubocop

Align the elements of a hash literal if they span more than one line.
Open

:too_long => "deve possuir no máximo 20 caracteres."}
Severity: Minor
Found in app/models/subject.rb by rubocop

Tab detected.
Open

belongs_to :teacher
Severity: Minor
Found in app/models/subject.rb by rubocop

Tab detected.
Open

maximum: 20,
Severity: Minor
Found in app/models/subject.rb by rubocop

Align the parameters of a method call if they span more than one line.
Open

presence: { message: "Não pode estar em branco!" },
length: { minimum: 5,
maximum: 20,
:too_short => "deve possuir mais de 5 caracteres.",
:too_long => "deve possuir no máximo 20 caracteres."}
Severity: Minor
Found in app/models/subject.rb by rubocop

Space inside } missing.
Open

:too_long => "deve possuir no máximo 20 caracteres."}
Severity: Minor
Found in app/models/subject.rb by rubocop

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

:too_short => "deve possuir mais de 5 caracteres.",
Severity: Minor
Found in app/models/subject.rb by rubocop

Use 2 (not 1) spaces for indentation.
Open

belongs_to :teacher
Severity: Minor
Found in app/models/subject.rb by rubocop

Tab detected.
Open

presence: { message: "Não pode estar em branco!" },
Severity: Minor
Found in app/models/subject.rb by rubocop

Inconsistent indentation detected.
Open

validates :teacher,
presence: { message: "não válido para criar matéria!" },
uniqueness: true
Severity: Minor
Found in app/models/subject.rb by rubocop

Use the new Ruby 1.9 hash syntax.
Open

:too_short => "deve possuir mais de 5 caracteres.",
Severity: Minor
Found in app/models/subject.rb by rubocop

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

presence: { message: "Não pode estar em branco!" },
Severity: Minor
Found in app/models/subject.rb by rubocop

There are no issues that match your filters.

Category
Status