Showing 572 of 572 total issues
Class has too many lines. [202/100] Open
class AdminsController < ApplicationController
skip_before_filter :authenticate, :only => ['new', 'create']
before_filter :validate_admin, :set_admin, :except => ['new', 'create']
def new
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for create is too high. [41.3/15] Open
def create
@user = User.find_by_id(session[:user_id])
@team = Team.find_by_id(@user.team.id)
d1 = submission_params[:disc1id]
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for create is too high. [33.23/15] Open
def create
oauth_hash = Rails.env.test? ? OmniAuth.config.mock_auth[:google] : env["omniauth.auth"]
user = User.user_from_oauth(oauth_hash)
admin = Admin.admin_from_oauth(oauth_hash)
session[:user_email] = oauth_hash[:info][:email]
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for download_approved_teams is too high. [29.43/15] Open
def download_approved_teams
time_zone = "Pacific Time (US & Canada)"
time_format = "%Y%m%d%H%M"
time = Time.now.in_time_zone(time_zone).strftime(time_format)
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Class AdminsController
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class AdminsController < ApplicationController
skip_before_filter :authenticate, :only => ['new', 'create']
before_filter :validate_admin, :set_admin, :except => ['new', 'create']
def new
Method has too many lines. [19/10] Open
def create
oauth_hash = Rails.env.test? ? OmniAuth.config.mock_auth[:google] : env["omniauth.auth"]
user = User.user_from_oauth(oauth_hash)
admin = Admin.admin_from_oauth(oauth_hash)
session[:user_email] = oauth_hash[:info][:email]
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [19/10] Open
def download_approved_teams
time_zone = "Pacific Time (US & Canada)"
time_format = "%Y%m%d%H%M"
time = Time.now.in_time_zone(time_zone).strftime(time_format)
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [18/10] Open
def create
@user = User.find_by_id(session[:user_id])
@team = Team.find_by_id(@user.team.id)
d1 = submission_params[:disc1id]
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [17/10] Open
def delete
if @admin.superadmin == true
c = 0
for a in Admin.all
if params.has_key? "delete_#{a.name}"
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for join_team is too high. [21.95/15] Open
def join_team
@passcode = params[:team_hash]
@team = Team.find_by_passcode(@passcode)
@team ||= Team.new()
return redirect_to without_team_path, :notice => "Unable to join team" if @passcode.empty? or !(@team.can_join?)
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [16/10] Open
def add_skill
skill_name = params[:skill].titleize
existing_skill = Skill.where(:name => skill_name).first
if existing_skill
if existing_skill.active
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for skills_str is too high. [19.08/15] Open
def skills_str
if talents.nil? || talents.length.zero?
return ''
end
skills = []
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for edit_disc is too high. [19.65/15] Open
def edit_disc
@disc = Discussion.find(params[:discussion][:id])
@disc.number = params[:discussion][:number]
@disc.day = params[:discussion][:day]
@disc.time = params[:discussion][:time]
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [13/10] Open
def transfer
if @admin.superadmin == true and params[:transfer_admin] != nil
other_admin = Admin.find(params[:transfer_admin])
@admin.superadmin = false
other_admin.superadmin = true
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for transfer is too high. [18.47/15] Open
def transfer
if @admin.superadmin == true and params[:transfer_admin] != nil
other_admin = Admin.find(params[:transfer_admin])
@admin.superadmin = false
other_admin.superadmin = true
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for approve is too high. [18.14/15] Open
def approve
@team = Team.find_by_id(params[:team_id])
@team.approved = true
@team.save!
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [13/10] Open
def do_email
@to.each_with_index do |to_email, counter|
email_team_paramters = { to: to_email,
from_name: @user.name,
to_name: @names[counter],
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Consider simplifying this complex logical expression. Open
if (time.month == 5 or time.month == 6 or (time.month == 4 and time.day >= 15) or (time.month == 7 and time.day <= 15) or
(time.month == 10 and time.day >= 15) or (time.month == 11 and time.day <= 15))
puts "Sending Emails to Admins..."
AdminMailer.send_look_at_submission
puts "done."
Assignment Branch Condition size for edit is too high. [17.72/15] Open
def edit
@user_to_remove = User.find_by_id(params[:unwanted_user])
@user_to_remove.leave_team
notice = ""
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Block has too many lines. [43/25] Open
Rails.application.routes.draw do
resources :users
get '/without_team', to: 'users#without'
post '/create_team', to: 'users#start_team'
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.