nofxx/symbolize

View on GitHub

Showing 4 of 8 total issues

Method symbolize has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
Open

      def symbolize(*attr_names) # rubocop:disable Metrics/AbcSize
        configuration = attr_names.extract_options!
        configuration.assert_valid_keys(:in, :within, :i18n, :scopes, :methods, :capitalize, :validate, :default, :allow_blank, :allow_nil, :type)

        enum           = configuration[:in] || configuration[:within]
Severity: Minor
Found in lib/symbolize/mongoid.rb - About 1 day 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

Method symbolize has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
Open

      def symbolize(*attr_names)
        configuration = attr_names.extract_options!
        configuration.assert_valid_keys(:in, :within, :i18n, :scopes, :methods, :capitalize, :validate, :default, :allow_blank, :allow_nil)

        enum           = configuration[:in] || configuration[:within]
Severity: Minor
Found in lib/symbolize/active_record.rb - About 1 day 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

Method symbolize has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def symbolize(*attr_names)
        configuration = attr_names.extract_options!
        configuration.assert_valid_keys(:in, :within, :i18n, :scopes, :methods, :capitalize, :validate, :default, :allow_blank, :allow_nil)

        enum           = configuration[:in] || configuration[:within]
Severity: Major
Found in lib/symbolize/active_record.rb - About 3 hrs to fix

    Method symbolize has 80 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def symbolize(*attr_names) # rubocop:disable Metrics/AbcSize
            configuration = attr_names.extract_options!
            configuration.assert_valid_keys(:in, :within, :i18n, :scopes, :methods, :capitalize, :validate, :default, :allow_blank, :allow_nil, :type)
    
            enum           = configuration[:in] || configuration[:within]
    Severity: Major
    Found in lib/symbolize/mongoid.rb - About 3 hrs to fix
      Severity
      Category
      Status
      Source
      Language