app/models/system_setting.rb

Summary

Maintainability
D
1 day
Test Coverage

Module has too many lines. [251/100]
Open

  module Defaults
    # RABID:
    #
    # Defaults, mostly taken from the system_setting table on an existing
    # Kete2 system's database.
Severity: Minor
Found in app/models/system_setting.rb by rubocop

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

Class SystemSetting has 82 methods (exceeds 20 allowed). Consider refactoring.
Open

class SystemSetting
  module Defaults
    # RABID:
    #
    # Defaults, mostly taken from the system_setting table on an existing
Severity: Major
Found in app/models/system_setting.rb - About 1 day to fix

    File system_setting.rb has 275 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class SystemSetting
      module Defaults
        # RABID:
        #
        # Defaults, mostly taken from the system_setting table on an existing
    Severity: Minor
    Found in app/models/system_setting.rb - About 2 hrs to fix

      Use \ instead of + or << to concatenate those strings.
      Open

            'You are about to download a file from Kete. Kete is an open digital repository' +
      Severity: Minor
      Found in app/models/system_setting.rb by rubocop

      This cop checks for string literal concatenation at the end of a line.

      Example:

      # bad
      some_str = 'ala' +
                 'bala'
      
      some_str = 'ala' <<
                 'bala'
      
      # good
      some_str = 'ala' \
                 'bala'

      Method SystemSetting::Defaults#force_https_on_restricted_pages is defined at both app/models/system_setting.rb:98 and app/models/system_setting.rb:412.
      Open

          def force_https_on_restricted_pages
      Severity: Minor
      Found in app/models/system_setting.rb by rubocop

      This cop checks for duplicated instance (or singleton) method definitions.

      Example:

      # bad
      
      def duplicated
        1
      end
      
      def duplicated
        2
      end

      Example:

      # bad
      
      def duplicated
        1
      end
      
      alias duplicated other_duplicated

      Example:

      # good
      
      def duplicated
        1
      end
      
      def other_duplicated
        2
      end

      Unused method argument - args. If it's necessary, use _ or _args as an argument name to indicate that it won't be used.
      Open

          def method_missing(meth, *args, &block)
      Severity: Minor
      Found in app/models/system_setting.rb by rubocop

      This cop checks for unused method arguments.

      Example:

      # bad
      
      def some_method(used, unused, _unused_but_allowed)
        puts used
      end

      Example:

      # good
      
      def some_method(used, _unused, _unused_but_allowed)
        puts used
      end

      Use \ instead of + or << to concatenate those strings.
      Open

              'Please ensure that your virus scan software is operating and is configured to ' +
      Severity: Minor
      Found in app/models/system_setting.rb by rubocop

      This cop checks for string literal concatenation at the end of a line.

      Example:

      # bad
      some_str = 'ala' +
                 'bala'
      
      some_str = 'ala' <<
                 'bala'
      
      # good
      some_str = 'ala' \
                 'bala'

      Use \ instead of + or << to concatenate those strings.
      Open

              "scan this download.\n" +
      Severity: Minor
      Found in app/models/system_setting.rb by rubocop

      This cop checks for string literal concatenation at the end of a line.

      Example:

      # bad
      some_str = 'ala' +
                 'bala'
      
      some_str = 'ala' <<
                 'bala'
      
      # good
      some_str = 'ala' \
                 'bala'

      Unused method argument - block. If it's necessary, use _ or _block as an argument name to indicate that it won't be used.
      Open

          def method_missing(meth, *args, &block)
      Severity: Minor
      Found in app/models/system_setting.rb by rubocop

      This cop checks for unused method arguments.

      Example:

      # bad
      
      def some_method(used, unused, _unused_but_allowed)
        puts used
      end

      Example:

      # good
      
      def some_method(used, _unused, _unused_but_allowed)
        puts used
      end

      Rename is_configured to configured?.
      Open

          def is_configured
      Severity: Minor
      Found in app/models/system_setting.rb by rubocop

      This cop makes sure that predicates are named properly.

      Example:

      # bad
      def is_even?(value)
      end
      
      # good
      def even?(value)
      end
      
      # bad
      def has_value?
      end
      
      # good
      def value?
      end

      Use \ instead of + or << to concatenate those strings.
      Open

              'and as such we can not guarantee the integrity of any file in the repository.  ' +
      Severity: Minor
      Found in app/models/system_setting.rb by rubocop

      This cop checks for string literal concatenation at the end of a line.

      Example:

      # bad
      some_str = 'ala' +
                 'bala'
      
      some_str = 'ala' <<
                 'bala'
      
      # good
      some_str = 'ala' \
                 'bala'

      When using method_missing, define respond_to_missing? and fall back on super.
      Open

          def method_missing(meth, *args, &block)
            # catch any forgotten defaults with a better error message
            raise "You probably asked for a default setting that does not exist. You need to add the #{meth} to Defaults"
          end
      Severity: Minor
      Found in app/models/system_setting.rb by rubocop

      This cop checks for the presence of method_missing without also defining respond_to_missing? and falling back on super.

      Example:

      #bad
      def method_missing(name, *args)
        # ...
      end
      
      #good
      def respond_to_missing?(name, include_private)
        # ...
      end
      
      def method_missing(name, *args)
        # ...
        super
      end

      Method SystemSetting.uses_basket_list_navigation_menu_on_every_page? is defined at both app/models/system_setting.rb:441 and app/models/system_setting.rb:447.
      Open

        def self.uses_basket_list_navigation_menu_on_every_page?
      Severity: Minor
      Found in app/models/system_setting.rb by rubocop

      This cop checks for duplicated instance (or singleton) method definitions.

      Example:

      # bad
      
      def duplicated
        1
      end
      
      def duplicated
        2
      end

      Example:

      # bad
      
      def duplicated
        1
      end
      
      alias duplicated other_duplicated

      Example:

      # good
      
      def duplicated
        1
      end
      
      def other_duplicated
        2
      end

      There are no issues that match your filters.

      Category
      Status