CocoaPods/CocoaPods

View on GitHub
lib/cocoapods/sandbox/path_list.rb

Summary

Maintainability
B
5 hrs
Test Coverage
A
100%

Method relative_glob has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

      def relative_glob(patterns, options = {})
        return [] if patterns.empty?

        dir_pattern = options[:dir_pattern]
        exclude_patterns = options[:exclude_patterns]
Severity: Minor
Found in lib/cocoapods/sandbox/path_list.rb - About 3 hrs 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 read_file_system has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

      def read_file_system
        unless root.exist?
          raise Informative, "Attempt to read non existent folder `#{root}`."
        end
        dirs = []
Severity: Minor
Found in lib/cocoapods/sandbox/path_list.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 relative_glob has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def relative_glob(patterns, options = {})
        return [] if patterns.empty?

        dir_pattern = options[:dir_pattern]
        exclude_patterns = options[:exclude_patterns]
Severity: Minor
Found in lib/cocoapods/sandbox/path_list.rb - About 1 hr to fix

    There are no issues that match your filters.

    Category
    Status