fga-gpp-mds/2017.1-Escola-X

View on GitHub

Showing 3,213 of 3,213 total issues

Block has too many lines. [30/25]
Open

namespace :cucumber do
Cucumber::Rake::Task.new({:ok => 'test:prepare'}, 'Run features that should pass') do |t|
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
t.fork = true # You may get faster startup if you set this to false
t.profile = 'default'
Severity: Minor
Found in lib/tasks/cucumber.rake by rubocop

NotificationsController tests '( is_employee? )' at least 5 times
Open

if ( is_employee? )
@notification = Notification.new
else
redirect_to "/errors/error_500"
end

SuspensionsController tests '( is_principal? )' at least 5 times
Open

if ( is_principal? )
@@alumn = Alumn.find(params[:alumn_id])
@suspension = Suspension.new
else
redirect_to "/errors/error_500"

SchoolMissesController tests '( is_employee? )' at least 4 times
Open

if ( is_employee? )
@school_miss = SchoolMiss.new
else
redirect_to "/errors/error_500"
end

ParentsController tests '( is_principal? )' at least 7 times
Open

if ( is_principal? )
@parent = Parent.new
else
redirect_to "/errors/error_500"
end
Severity: Minor
Found in app/controllers/parents_controller.rb by reek

StrikesController tests '( is_employee? )' at least 5 times
Open

if ( is_employee? )
@@alumn = Alumn.find(params[:alumn_id])
@strike = Strike.new
else
redirect_to "/errors/error_500"
Severity: Minor
Found in app/controllers/strikes_controller.rb by reek

AlumnsController tests '( is_principal? )' at least 7 times
Open

if ( is_principal? )
@shifts = Shift.all
@alumn = Alumn.new
@@parent = Parent.find(params[:parent_id])
@classrooms = Classroom.all.order('name_classroom')
Severity: Minor
Found in app/controllers/alumns_controller.rb by reek

ClassroomsController tests '( is_principal? )' at least 7 times
Open

if ( is_principal? )
@classroom = Classroom.new
@classroom_grades = ClassroomGrade.all
@shifts = Shift.all
else

PrincipalController tests '( is_principal? )' at least 3 times
Open

if ( is_principal? )
@principal = Employee.find(params[:id])
end
end
 
 

EmployeesController tests '( is_principal? )' at least 7 times
Open

if ( is_principal? )
@user = Employee.find(params[:id])
render action: "../users/edit_password"
else
redirect_to "/errors/error_500"

TeachersController tests '( is_principal? )' at least 5 times
Open

if ( is_principal? )
@shifts = Shift.all
@teacher = Teacher.new
else
redirect_to "/errors/error_500"
Severity: Minor
Found in app/controllers/teachers_controller.rb by reek

SecretariesController tests '( is_principal? )' at least 6 times
Open

if ( is_principal? )
@secretaries = Secretary.all
if params[:search]
string_to_search = params[:search].strip.upcase!
@secretaries = Secretary.search(string_to_search).order("created_at DESC")

SubjectsController tests '( is_principal? )' at least 8 times
Open

if ( is_principal? )
@classroom_grades = ClassroomGrade.all
@subject = Subject.new
else
redirect_to "/errors/error_500"
Severity: Minor
Found in app/controllers/subjects_controller.rb by reek

Method give_presence_to_alumn has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def give_presence_to_alumn(date , alumn)
school_misses = nil
if (alumn != nil)
school_misses = alumn.school_misses.all
Severity: Minor
Found in app/controllers/reader_controller.rb - About 35 mins to fix

Method destroy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def destroy
if( is_principal? )
@suspension = Suspension.find(params[:id])
@alumn = Alumn.find_by_id(@suspension.alumn_id)
if( @suspension.destroy )
Severity: Minor
Found in app/controllers/suspensions_controller.rb - About 35 mins to fix

Method destroy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def destroy
if ( is_employee? )
@strike = Strike.find(params[:id])
@alumn = Alumn.find_by_id(@strike.alumn_id)
if @strike.destroy
Severity: Minor
Found in app/controllers/strikes_controller.rb - About 35 mins to fix

Method add_classroom has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def add_classroom
if ( is_principal? )
@classroom = Classroom.find(params[:id])
@subject = Subject.find(params[:subject_id])
if !((ClassroomSubject.where(classroom_id: @classroom.id).where(subject_id: @subject.id)).exists?)
Severity: Minor
Found in app/controllers/subjects_controller.rb - About 35 mins to fix

Api::SuspensionsController has no descriptive comment
Open

class Api::SuspensionsController < ApplicationController

ClassroomsController assumes too much for instance variable '@alumn'
Open

class ClassroomsController < ApplicationController

GradesController assumes too much for instance variable '@subject'
Open

class GradesController < ApplicationController
Severity: Minor
Found in app/controllers/grades_controller.rb by reek
Severity
Category
Status
Source
Language