Showing 32 of 32 total issues
Assignment Branch Condition size for post_grades is too high. [20.49/15] Open
def post_grades if is_secretary? @classroom = Classroom.find(params[:id]) @subject = Subject.find(params[:subject_id]) @alumn = Alumn.find(params[:alumn_id])
- Read upRead up
- Exclude checks
Method has too many lines. [12/10] Open
def post_grades if is_secretary? @classroom = Classroom.find(params[:id]) @subject = Subject.find(params[:subject_id]) @alumn = Alumn.find(params[:alumn_id])
- Read upRead up
- Exclude checks
GradesController has at least 5 instance variables Open
class GradesController < ApplicationController
- Read upRead up
- Exclude checks
GradesController#post_grades has approx 7 statements Open
def post_grades
- Read upRead up
- Exclude checks
GradesController assumes too much for instance variable '@subject' Open
class GradesController < ApplicationController
- Read upRead up
- Exclude checks
GradesController assumes too much for instance variable '@current_user' Open
class GradesController < ApplicationController
- Read upRead up
- Exclude checks
GradesController assumes too much for instance variable '@alumn' Open
class GradesController < ApplicationController
- Read upRead up
- Exclude checks
GradesController assumes too much for instance variable '@classroom' Open
class GradesController < ApplicationController
- Read upRead up
- Exclude checks
GradesController assumes too much for instance variable '@grade' Open
class GradesController < ApplicationController
- Read upRead up
- Exclude checks
GradesController#self.create calls 'subject.id' 2 times Open
if !(Grade.where(alumn_id:alumn.id).where(subject_id: subject.id).exists?) @grade = Grade.new(alumn_id: alumn.id, subject_id: subject.id,
- Read upRead up
- Exclude checks
GradesController#self.create calls 'alumn.id' 2 times Open
if !(Grade.where(alumn_id:alumn.id).where(subject_id: subject.id).exists?) @grade = Grade.new(alumn_id: alumn.id, subject_id: subject.id,
- Read upRead up
- Exclude checks
Line is too long. [85/80] Open
@grades = Grade.where(classroom_id:@classroom.id).where(subject_id:@subject.id)
- Exclude checks
Align the elements of a hash literal if they span more than one line. Open
classroom_id: alumn.classroom_id)
- Read upRead up
- Exclude checks
Use a guard clause instead of wrapping the code inside a conditional expression. Open
if is_secretary?
- Read upRead up
- Exclude checks
Space missing after colon. Open
@grades = Grade.where(classroom_id:@classroom.id).where(subject_id:@subject.id)
- Read upRead up
- Exclude checks
Space missing after comma. Open
GradeHistoriesController.create(@grade,@current_user)
- Read upRead up
- Exclude checks
Do not put a space between a method name and the opening parenthesis. Open
def self.update_alumn (alumn)
- Read upRead up
- Exclude checks
Space missing after colon. Open
if !(Grade.where(alumn_id:alumn.id).where(subject_id: subject.id).exists?)
- Read upRead up
- Exclude checks
Space missing after colon. Open
if !Grade.where(alumn_id:alumn.id).where(subject_id: subject.id).exists?
- Read upRead up
- Exclude checks
Do not put a space between a method name and the opening parenthesis. Open
def self.create (alumn)
- Read upRead up
- Exclude checks
Don't use parentheses around the condition of an if
. Open
if (is_secretary? or is_principal?)
- Read upRead up
- Exclude checks
Don't use parentheses around a method call. Open
if !(Grade.where(alumn_id:alumn.id).where(subject_id: subject.id).exists?)
- Read upRead up
- Exclude checks
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
render "grades/index"
- Read upRead up
- Exclude checks
Space missing after colon. Open
@grades = Grade.where(classroom_id:@classroom.id).where(subject_id:@subject.id)
- Read upRead up
- Exclude checks
Favor unless
over if
for negative conditions. Open
if !Grade.where(alumn_id:alumn.id).where(subject_id: subject.id).exists? GradesController.create(alumn) end
- Read upRead up
- Exclude checks
Favor unless
over if
for negative conditions. Open
if !(Grade.where(alumn_id:alumn.id).where(subject_id: subject.id).exists?) @grade = Grade.new(alumn_id: alumn.id, subject_id: subject.id, classroom_id: alumn.classroom_id) @grade.save end
- Read upRead up
- Exclude checks
Use next
to skip iteration. Open
if !(Grade.where(alumn_id:alumn.id).where(subject_id: subject.id).exists?)
- Read upRead up
- Exclude checks
Line is too long. [108/80] Open
@grade = Grade.find_by_classroom_id_and_subject_id_and_alumn_id(@classroom.id, @subject.id, @alumn.id)
- Exclude checks
Use a guard clause instead of wrapping the code inside a conditional expression. Open
if (is_secretary? or is_principal?)
- Read upRead up
- Exclude checks