CocoaPods/Core

View on GitHub
lib/cocoapods-core/source.rb

Summary

Maintainability
C
1 day
Test Coverage

Class Source has 35 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Source
    # The default branch in which the specs are stored
    DEFAULT_SPECS_BRANCH = 'master'.freeze

    # @return [Pod::Source::Metadata] The metadata for this source.
Severity: Minor
Found in lib/cocoapods-core/source.rb - About 4 hrs to fix

    File source.rb has 263 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'cocoapods-core/source/acceptor'
    require 'cocoapods-core/source/aggregate'
    require 'cocoapods-core/source/health_reporter'
    require 'cocoapods-core/source/manager'
    require 'cocoapods-core/source/metadata'
    Severity: Minor
    Found in lib/cocoapods-core/source.rb - About 2 hrs to fix

      Method search has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def search(query)
            unless specs_dir
              raise Informative, "Unable to find a source named: `#{name}`"
            end
            if query.is_a?(Dependency)
      Severity: Minor
      Found in lib/cocoapods-core/source.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 specification_path has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def specification_path(name, version)
            raise ArgumentError, 'No name' unless name
            raise ArgumentError, 'No version' unless version
            path = pod_path(name) + version.to_s
            specification_path = path + "#{name}.podspec.json"
      Severity: Minor
      Found in lib/cocoapods-core/source.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 versions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def versions(name)
            return nil unless specs_dir
            raise ArgumentError, 'No name' unless name
            pod_dir = pod_path(name)
            return unless pod_dir.exist?
      Severity: Minor
      Found in lib/cocoapods-core/source.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

      There are no issues that match your filters.

      Category
      Status