CocoaPods/CocoaPods

View on GitHub
lib/cocoapods/installer/podfile_validator.rb

Summary

Maintainability
A
2 hrs
Test Coverage
A
100%

Method validate_no_abstract_only_pods! has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

      def validate_no_abstract_only_pods!
        @podfile_dependency_cache.target_definition_list.each do |target_definition|
          dependencies = @podfile_dependency_cache.target_definition_dependencies(target_definition)
          next if dependencies.empty?
          next unless target_definition.abstract?
Severity: Minor
Found in lib/cocoapods/installer/podfile_validator.rb - About 1 hr 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_no_duplicate_targets! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def validate_no_duplicate_targets!
        @podfile_dependency_cache.target_definition_list.group_by { |td| [td.name, td.user_project_path] }.
          each do |(name, project), definitions|
          next unless definitions.size > 1
          error = "The target `#{name}` is declared multiple times"
Severity: Minor
Found in lib/cocoapods/installer/podfile_validator.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