CocoaPods/Xcodeproj

View on GitHub
lib/xcodeproj/project/object_attributes.rb

Summary

Maintainability
A
3 hrs
Test Coverage
A
96%

Method validate_value has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        def validate_value(object)
          return unless object
          acceptable = classes.find { |klass| object.class == klass || object.class < klass }
          if type == :simple
            raise "[Xcodeproj] Type checking error: got `#{object.class}` " \
Severity: Minor
Found in lib/xcodeproj/project/object_attributes.rb - About 55 mins 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 validate_value_for_key has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        def validate_value_for_key(object, key)
          unless type == :references_by_keys
            raise '[Xcodeproj] This method should be called only for ' \
              'attributes of type `references_by_keys`'
          end
Severity: Minor
Found in lib/xcodeproj/project/object_attributes.rb - About 55 mins 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 attribute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

          def attribute(name, klass, default_value = nil)
            attrb = AbstractObjectAttribute.new(:simple, name, self)
            attrb.classes = [klass]
            attrb.default_value = default_value
            add_attribute(attrb)
Severity: Minor
Found in lib/xcodeproj/project/object_attributes.rb - About 55 mins 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 has_one has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

          def has_one(singular_name, isas)
            isas = [isas] unless isas.is_a?(Array)
            attrb = AbstractObjectAttribute.new(:to_one, singular_name, self)
            attrb.classes = isas
            add_attribute(attrb)
Severity: Minor
Found in lib/xcodeproj/project/object_attributes.rb - About 45 mins 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 attributes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def attributes
            unless @full_attributes
              attributes = @attributes || []
              if superclass.respond_to?(:attributes)
                super_attributes = superclass.attributes
Severity: Minor
Found in lib/xcodeproj/project/object_attributes.rb - About 25 mins 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

There are no issues that match your filters.

Category
Status