Updated

app/controllers/admin / locks_controller.rb

A
45 lines of codes
6 methods
3.6 complexity/method
3 churn
21.4 complexity
0 duplications
class Admin::LocksController < Admin::AdminController
  1. Admin::LocksController assumes too much for instance variable '@petition'
  2. Admin::LocksController has no descriptive comment
before_action :fetch_petition def show @petition.update_lock!(current_user) respond_to do |format| format.json end end def create @petition.checkout!(current_user) respond_to do |format| format.json end end def update @petition.force_checkout!(current_user) respond_to do |format| format.json end end def destroy @petition.release!(current_user) respond_to do |format| format.json end end private def last_request_update_allowed? false end def fetch_petition @petition = Petition.find(params[:petition_id]) end end