CocoaPods/cocoapods-try

View on GitHub

Showing 3 of 3 total issues

Method install_podfile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def install_podfile(proj)
        return unless proj
        dirname = Pathname.new(proj).dirname
        podfile_path = dirname + 'Podfile'
        if podfile_path.exist?
Severity: Minor
Found in lib/pod/command/try.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 projects_in_dir has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def projects_in_dir(dir)
        glob_match = Dir.glob("#{dir}/**/*.xc{odeproj,workspace}")
        glob_match = glob_match.reject do |p|
          next true if p.include?('Pods.xcodeproj')
          next true if p.end_with?('.xcodeproj/project.xcworkspace')
Severity: Minor
Found in lib/pod/command/try.rb - About 35 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 settings_from_folder has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def self.settings_from_folder(path)
      settings_path = Pathname.new(path) + '.cocoapods.yml'
      return TrySettings.new unless File.exist? settings_path

      settings = YAMLHelper.load_file(settings_path)
Severity: Minor
Found in lib/pod/try_settings.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

Severity
Category
Status
Source
Language