Showing 1,076 of 1,190 total issues

Class has too many lines. [548/150]
Open

  class Order < Spree::Base
    PAYMENT_STATES = %w(balance_due credit_owed failed paid void)
    SHIPMENT_STATES = %w(backorder canceled partial pending ready shipped)

    include Spree::Order::Checkout
Severity: Minor
Found in core/app/models/spree/order.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.

Assignment Branch Condition size for included is too high. [294.7/45]
Open

      def self.included(klass)
        klass.class_eval do
          class_attribute :next_event_transitions
          class_attribute :previous_states
          class_attribute :checkout_flow

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. [239/50]
Open

      def self.included(klass)
        klass.class_eval do
          class_attribute :next_event_transitions
          class_attribute :previous_states
          class_attribute :checkout_flow

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.

File order_spec.rb has 912 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'spec_helper'

class FakeCalculator < Spree::Calculator
  def compute(_computable)
    5
Severity: Major
Found in core/spec/models/spree/order_spec.rb - About 2 days to fix

    Class has too many lines. [290/150]
    Open

      class Shipment < Spree::Base
        include Spree::Core::NumberGenerator.new(prefix: 'H', length: 11)
    
        include NumberAsParam
    
    
    Severity: Minor
    Found in core/app/models/spree/shipment.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.

    Method up has 410 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def up
        # This migration is just a compressed version of all the previous
        # migrations for spree_core. Do not run it if one of the core tables
        # already exists. Assume the best.
        return if data_source_exists?(:spree_addresses)
    Severity: Major
    Found in core/db/migrate/20120831092320_spree_one_two.rb - About 2 days to fix

      Class has too many lines. [281/150]
      Open

        class Product < Spree::Base
          extend FriendlyId
          include ActsAsTaggable
          friendly_id :slug_candidates, use: :history
      
      
      Severity: Minor
      Found in core/app/models/spree/product.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.

      Block has too many lines. [237/50]
      Open

              klass.class_eval do
                class_attribute :next_event_transitions
                class_attribute :previous_states
                class_attribute :checkout_flow
                class_attribute :checkout_steps

      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.

      File payment_spec.rb has 758 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'spec_helper'
      
      describe Spree::Payment, type: :model do
        let(:order) { Spree::Order.create }
        let(:refund_reason) { create(:refund_reason) }
      Severity: Major
      Found in core/spec/models/spree/payment_spec.rb - About 1 day to fix

        Class has too many lines. [241/150]
        Open

          class Variant < Spree::Base
            acts_as_paranoid
            acts_as_list scope: :product
        
            belongs_to :product, touch: true, class_name: 'Spree::Product', inverse_of: :variants
        Severity: Minor
        Found in core/app/models/spree/variant.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 89 methods (exceeds 20 allowed). Consider refactoring.
        Open

          class Order < Spree::Base
            PAYMENT_STATES = %w(balance_due credit_owed failed paid void)
            SHIPMENT_STATES = %w(backorder canceled partial pending ready shipped)
        
            include Spree::Order::Checkout
        Severity: Major
        Found in core/app/models/spree/order.rb - About 1 day to fix

          File variant_spec.rb has 715 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'spec_helper'
          
          describe Spree::Variant, type: :model do
            let!(:variant) { create(:variant) }
            let(:master_variant) { create(:master_variant) }
          Severity: Major
          Found in core/spec/models/spree/variant_spec.rb - About 1 day to fix

            Class has too many lines. [228/150]
            Open

                  class Order
                    def self.import(user, params)
                      ensure_country_id_from_params params[:ship_address_attributes]
                      ensure_state_id_from_params params[:ship_address_attributes]
                      ensure_country_id_from_params params[:bill_address_attributes]

            This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

            File shipment_spec.rb has 654 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'spec_helper'
            require 'benchmark'
            
            describe Spree::Shipment, type: :model do
              let(:order) do
            Severity: Major
            Found in core/spec/models/spree/shipment_spec.rb - About 1 day to fix

              Class has too many lines. [205/150]
              Open

                class StoreCredit < Spree::Base
                  acts_as_paranoid
              
                  VOID_ACTION       = 'void'.freeze
                  CANCEL_ACTION     = 'cancel'.freeze

              This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

              File orders_controller_spec.rb has 638 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'spec_helper'
              require 'spree/testing_support/bar_ability'
              
              module Spree
                describe Api::V1::OrdersController, type: :controller do
              Severity: Major
              Found in api/spec/controllers/spree/api/v1/orders_controller_spec.rb - About 1 day to fix

                File checkout_spec.rb has 637 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require 'spec_helper'
                require 'spree/testing_support/order_walkthrough'
                
                describe Spree::Order, type: :model do
                  let(:order) { Spree::Order.new }
                Severity: Major
                Found in core/spec/models/spree/order/checkout_spec.rb - About 1 day to fix

                  Class has too many lines. [200/150]
                  Open

                  class Spree::Admin::ResourceController < Spree::Admin::BaseController
                    include Spree::Backend::Callbacks
                  
                    helper_method :new_object_url, :edit_object_url, :object_url, :collection_url
                    before_action :load_resource, except: :update_positions

                  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. [198/150]
                  Open

                    class InstallGenerator < Rails::Generators::Base
                      class_option :migrate, type: :boolean, default: true, banner: 'Run Spree migrations'
                      class_option :seed, type: :boolean, default: true, banner: 'load seed data (migrations must be run)'
                      class_option :sample, type: :boolean, default: true, banner: 'load sample data (migrations must be run)'
                      class_option :copy_views, type: :boolean, default: true, banner: 'copy frontend views from spree to your application for easy customization'

                  This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

                  File store_credit_spec.rb has 617 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require 'spec_helper'
                  
                  describe 'StoreCredit' do
                    let(:currency) { 'TEST' }
                    let(:store_credit) { build(:store_credit, store_credit_attrs) }
                  Severity: Major
                  Found in core/spec/models/spree/store_credit_spec.rb - About 1 day to fix
                    Severity
                    Category
                    Status
                    Source
                    Language