app/controllers/employees_controller.rb
# File name: employees_controller.rb# Class name: EmployeesController# Description: Controller used to communicate with the views of emplyoees EmployeesController assumes too much for instance variable '@user'
EmployeesController assumes too much for instance variable '@employee'
Missing top-level class documentation comment.class EmployeesController < UsersControllerTab detected.
Use 2 (not 1) spaces for indentation. include SessionsHelper Tab detected. def indexDon't use parentheses around a method call.
Use 2 (not 4) spaces for indentation.
Space inside parentheses detected.
Tab detected.
Don't use parentheses around the condition of an `if`. if ( is_employee? )Tab detected.
Use 2 (not 3) spaces for indentation. @employees = Employee.allTab detected.
Align `else` with `if`. elseUse 2 (not 1) spaces for indentation.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
Tab detected. redirect_to "/errors/error_500"Tab detected. end`end` at 14, 3 is not aligned with `def` at 8, 1.
Tab detected. end Extra blank line detected. Tab detected.
Use empty lines between method definitions. def edit_password_employeeEmployeesController tests '( is_principal? )' at least 7 times
Don't use parentheses around a method call.
Tab detected.
Space inside parentheses detected.
Don't use parentheses around the condition of an `if`.
Use 2 (not 1) spaces for indentation. if ( is_principal? )Tab detected.
Use 2 (not 1) spaces for indentation. @user = Employee.find(params[:id])Unnecessary spacing detected.
Tab detected.
Prefer single-quoted strings when you don't need string interpolation or special symbols. render action: "../users/edit_password"Tab detected. elseUse 2 (not 6) spaces for indentation.
Tab detected.
Prefer single-quoted strings when you don't need string interpolation or special symbols. redirect_to "/errors/error_500"Tab detected. endTab detected. end Tab detected. def update_password_employeeDon't use parentheses around a method call.
Don't use parentheses around the condition of an `if`.
Space inside parentheses detected.
Use 2 (not 1) spaces for indentation.
Tab detected. if ( is_principal? )Use 2 (not 1) spaces for indentation.
Tab detected. @user = Employee.find(params[:id])Tab detected.
Don't use parentheses around the condition of an `if`.
Don't use parentheses around a method call. if (@user.update!(employee_params))Use 2 (not 1) spaces for indentation.
Tab detected. redirect_to @userTab detected. elseTab detected.
Use 2 (not 1) spaces for indentation.
Prefer single-quoted strings when you don't need string interpolation or special symbols. render action: "../users/edit_password"Tab detected. endTab detected. elsePrefer single-quoted strings when you don't need string interpolation or special symbols.
Tab detected.
Use 2 (not 6) spaces for indentation. redirect_to "/errors/error_500"Tab detected. endTab detected. end Inconsistent indentation detected. def showSpace inside parentheses detected.
Don't use parentheses around a method call.
Use a guard clause instead of wrapping the code inside a conditional expression.
Don't use parentheses around the condition of an `if`.
Favor modifier `if` usage when having a single-line body. Another good alternative is the usage of control flow `&&`/`||`. if ( is_employee? ) @employee = Employee.find(params[:id]) end end Inconsistent indentation detected. def newUse a guard clause instead of wrapping the code inside a conditional expression.
Don't use parentheses around a method call.
Space inside parentheses detected.
Don't use parentheses around the condition of an `if`. if ( is_principal? )Use 2 (not -1) spaces for indentation.
Tab detected. @shifts = Shift.allInconsistent indentation detected. @employee = Employee.new end end Inconsistent indentation detected. def editSpace inside parentheses detected.
Don't use parentheses around a method call.
Use a guard clause instead of wrapping the code inside a conditional expression.
Don't use parentheses around the condition of an `if`. if ( is_principal? )Tab detected.
Use 2 (not -1) spaces for indentation. @shifts = Shift.allInconsistent indentation detected. @employee = Employee.find(params[:id]) end end Inconsistent indentation detected. def createDon't use parentheses around the condition of an `if`.
Space inside parentheses detected.
Use a guard clause instead of wrapping the code inside a conditional expression.
Don't use parentheses around a method call. if ( is_principal? )Tab detected.
Use 2 (not -1) spaces for indentation. @shifts = Shift.allInconsistent indentation detected. @employee = Employee.new(employee_params) Don't use parentheses around the condition of an `if`.
Inconsistent indentation detected.
Don't use parentheses around a method call.
Favor modifier `if` usage when having a single-line body. Another good alternative is the usage of control flow `&&`/`||`. if (@employee.save) redirect_to users_path end end end Inconsistent indentation detected. def updateDon't use parentheses around the condition of an `if`.
Don't use parentheses around a method call.
Space inside parentheses detected.
Use a guard clause instead of wrapping the code inside a conditional expression. if ( is_principal? )Use 2 (not -1) spaces for indentation.
Tab detected. @shifts = Shift.allInconsistent indentation detected. @employee = Employee.find(params[:id])Space inside parentheses detected.
Don't use parentheses around the condition of an `if`.
Inconsistent indentation detected.
Don't use parentheses around a method call. if ( @employee.update(employee_params) ) redirect_to @employee else render 'edit' end end end Inconsistent indentation detected. def destroySpace inside parentheses detected.
Don't use parentheses around the condition of an `if`.
Use a guard clause instead of wrapping the code inside a conditional expression.
Don't use parentheses around a method call. if ( is_principal? ) @employee = Employee.find(params[:id]) @employee.destroy redirect_to users_path end end Keep a blank line before and after `private`.
Indent access modifiers like `private`.privateMethod has too many lines. [11/10]
Inconsistent indentation detected. def employee_paramsSpace inside parentheses detected. params.require(:employee).permit( :registry,Align the parameters of a method call if they span more than one line.
Tab detected. :admission_date,Tab detected.
Align the parameters of a method call if they span more than one line. :employee_cpf,Tab detected.
Align the parameters of a method call if they span more than one line. :shift,Tab detected.
Align the parameters of a method call if they span more than one line. :password,Align the parameters of a method call if they span more than one line.
Tab detected. :name,Align the parameters of a method call if they span more than one line.
Tab detected. :address,Align the parameters of a method call if they span more than one line.
Tab detected. :phone,Align the parameters of a method call if they span more than one line.
Tab detected. :gender,Tab detected.
Align the parameters of a method call if they span more than one line. :birth_date,Align the parameters of a method call if they span more than one line.
Tab detected. :shift_id)Extra empty line detected at method body end. Tab detected.
`end` at 105, 3 is not aligned with `def` at 92, 2. endend