armandofox/audience1st

View on GitHub

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)

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'
Severity: Minor
Found in app/models/customer.rb by rubocop

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

Severity: Minor
Found in app/models/items/voucher.rb by rubocop

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)
Severity: Minor
Found in app/controllers/store_controller.rb by rubocop

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
  
Severity: Minor
Found in app/models/valid_voucher.rb by rubocop

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
Severity: Major
Found in app/models/order.rb - About 7 hrs to fix

    Class Voucher has 49 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Voucher < Item
      belongs_to :showdate
    
      class ReservationError < StandardError ;  end
    
    
    Severity: Minor
    Found in app/models/items/voucher.rb - About 6 hrs to fix

      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'
      Severity: Minor
      Found in app/models/customer.rb - About 6 hrs to fix

        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
        Severity: Minor
        Found in app/helpers/dates_helper.rb by rubocop

        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
        
        
        Severity: Minor
        Found in app/models/vouchertype.rb - About 5 hrs to fix

          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
          Severity: Minor
          Found in app/models/order.rb - About 5 hrs to fix

            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
            Severity: Minor
            Found in app/controllers/customers_controller.rb - About 4 hrs to fix

              Method has too many lines. [54/30]
              Open

                def csv
                  csv = CSV.generate(:force_quotes => true) do |csv|
                    csv << [
                      'Payment Type',
                      'Account Code #',

              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
                
              Severity: Minor
              Found in app/models/valid_voucher.rb - About 4 hrs to fix

                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'
                Severity: Minor
                Found in app/models/customer.rb - About 4 hrs to fix

                  Method has too many lines. [47/30]
                  Open

                    def index
                      @total = 0
                      @params = {}
                      @page_title = "Donation history"
                      @page = (params[:page] || '1').to_i

                  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,

                  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])

                  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

                  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|
                  Severity: Minor
                  Found in app/models/seatmap/parser.rb - About 3 hrs to fix

                  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"

                  Further reading

                  Severity
                  Category
                  Status
                  Source
                  Language