CocoaPods/Core

View on GitHub
lib/cocoapods-core/specification/consumer.rb

Summary

Maintainability
A
2 hrs
Test Coverage

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

      def _prepare_script_phases(value)
        if value
          value.map do |script_phase|
            if script_phase.is_a?(Hash)
              phase = Specification.convert_keys_to_symbol(script_phase)
Severity: Minor
Found in lib/cocoapods-core/specification/consumer.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 merge_values has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

      def merge_values(attr, existing_value, new_value)
        return existing_value if new_value.nil?
        return new_value if existing_value.nil?

        if attr.types.include?(TrueClass)
Severity: Minor
Found in lib/cocoapods-core/specification/consumer.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 prepare_value has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def prepare_value(attr, value)
        if attr.container == Array
          value = if value.is_a?(Hash)
                    [value]
                  else
Severity: Minor
Found in lib/cocoapods-core/specification/consumer.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

Method merge_hash_value has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def merge_hash_value(attr, old, new)
        case attr.name
        when :info_plist
          new
        when ->(name) { spec.non_library_specification? && [:pod_target_xcconfig, :user_target_xcconfig, :xcconfig].include?(name) }
Severity: Minor
Found in lib/cocoapods-core/specification/consumer.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