Updated

app/controllers/admin / trending_ips_controller.rb

A
20 lines of codes
3 methods
4.5 complexity/method
1 churn
13.53 complexity
0 duplications
class Admin::TrendingIpsController < Admin::AdminController
  1. Admin::TrendingIpsController assumes too much for instance variable '@petition'
  2. Admin::TrendingIpsController has no descriptive comment
before_action :fetch_petition before_action :fetch_trending_ips def index respond_to do |format| format.html end end private def fetch_petition @petition = Petition.find(params[:petition_id]) end def fetch_trending_ips @trending_ips = @petition.trending_ips.search(params[:q], page: params[:page]) end end