Showing 387 of 387 total issues
Class has too many lines. [358/250] Open
class CustomersController < ApplicationController
# Actions requiring no login, customer login, and staff login respectively
ACTIONS_WITHOUT_LOGIN = %w(new user_create forgot_password guest_checkout guest_checkout_create reset_token)
CUSTOMER_ACTIONS = %w(show edit update change_password_for change_secret_question)
- 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.
Class has too many lines. [339/250] Open
class Customer < ActiveRecord::Base
require_dependency 'customer/roles'
require_dependency 'customer/search'
require_dependency 'customer/special_customers'
- 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.
Class has too many lines. [284/250] Open
class Voucher < Item
belongs_to :showdate
class ReservationError < StandardError ; end
- 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.
Class has too many lines. [280/250] Open
class StoreController < ApplicationController
include StoreHelper
skip_before_filter :verify_authenticity_token, :only => %w(show_changed showdate_changed)
- 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.
Class has too many lines. [266/250] Open
class ValidVoucher < ActiveRecord::Base
# Capacity is infinite if it is left blank
INFINITE = 100_000
- 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.
Class Order
has 54 methods (exceeds 20 allowed). Consider refactoring. Open
class Order < ActiveRecord::Base
belongs_to :customer
belongs_to :purchaser, :class_name => 'Customer'
belongs_to :processed_by, :class_name => 'Customer'
has_many :items, :autosave => true, :dependent => :destroy
Class Voucher
has 49 methods (exceeds 20 allowed). Consider refactoring. Open
class Voucher < Item
belongs_to :showdate
class ReservationError < StandardError ; end
Class Customer
has 47 methods (exceeds 20 allowed). Consider refactoring. Open
class Customer < ActiveRecord::Base
require_dependency 'customer/roles'
require_dependency 'customer/search'
require_dependency 'customer/special_customers'
Method has too many lines. [71/30] Open
def select_date_with_shortcuts(name, options={})
t = Time.current
t8601 = t.iso8601
start_date = (options[:from] || 1.day.ago).at_beginning_of_day
end_date = (options[:to] || t).at_beginning_of_day
- 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.
Class Vouchertype
has 42 methods (exceeds 20 allowed). Consider refactoring. Open
class Vouchertype < ActiveRecord::Base
belongs_to :account_code
validates_associated :account_code
File order.rb
has 375 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Order < ActiveRecord::Base
belongs_to :customer
belongs_to :purchaser, :class_name => 'Customer'
belongs_to :processed_by, :class_name => 'Customer'
has_many :items, :autosave => true, :dependent => :destroy
File customers_controller.rb
has 360 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'will_paginate/array'
class CustomersController < ApplicationController
# Actions requiring no login, customer login, and staff login respectively
Method has too many lines. [54/30] Open
def csv
csv = CSV.generate(:force_quotes => true) do |csv|
csv << [
'Payment Type',
'Account Code #',
- 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.
Class ValidVoucher
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class ValidVoucher < ActiveRecord::Base
# Capacity is infinite if it is left blank
INFINITE = 100_000
File customer.rb
has 340 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Customer < ActiveRecord::Base
require_dependency 'customer/roles'
require_dependency 'customer/search'
require_dependency 'customer/special_customers'
Method has too many lines. [47/30] Open
def index
@total = 0
@params = {}
@page_title = "Donation history"
@page = (params[:page] || '1').to_i
- 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. [46/30] Open
def create
@order = Order.create(
:walkup => true,
:customer => Customer.walkup_customer,
:purchaser => Customer.walkup_customer,
- 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. [45/30] Open
def run_special
return unless (klass = validate_report_type params[:report_name])
action = params[:what]
full_report_url = request.fullpath
@report = klass.__send__(:new, params[:output])
- 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. [44/30] Open
def parse
unless valid?
return @import.errors.add(:base, 'Import is invalid')
end
# A Goldstar will-call is always for exactly 1 performance
- 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 parse_rows
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def parse_rows
@as_js = []
@seat_rows.each do |row|
row_string = ''
row.each do |cell|
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"