Showing 93 of 105 total issues
File target_definition.rb
has 587 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Pod
class Podfile
# The TargetDefinition stores the information of a CocoaPods static
# library. The target definition can be linked with one or more targets of
# the user project.
Class TargetDefinition
has 67 methods (exceeds 20 allowed). Consider refactoring. Open
class TargetDefinition
# @return [TargetDefinition, Podfile] the parent target definition or the
# Podfile if the receiver is root.
#
attr_reader :parent
Class Specification
has 51 methods (exceeds 20 allowed). Consider refactoring. Open
class Specification
include Pod::Specification::DSL
include Pod::Specification::DSL::Deprecations
include Pod::Specification::RootAttributesAccessors
include Pod::Specification::JSONSupport
Method compare_segments
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def compare_segments(other)
return unless other.is_a?(Pod::Version)
return 0 if @version == other.version
compare = proc do |segments, other_segments, is_pre_release|
- Read upRead up
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
File specification.rb
has 400 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'active_support/core_ext/string/strip.rb'
require 'cocoapods-core/specification/consumer'
require 'cocoapods-core/specification/dsl'
require 'cocoapods-core/specification/linter'
File linter.rb
has 399 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'cocoapods-core/specification/linter/result'
require 'cocoapods-core/specification/linter/analyzer'
module Pod
class Specification
Class Linter
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
class Linter
# @return [Specification] the specification to lint.
#
attr_reader :spec
Class CDNSource
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class CDNSource < Source
include Concurrent
MAX_NUMBER_OF_RETRIES = (ENV['COCOAPODS_CDN_MAX_NUMBER_OF_RETRIES'] || 5).to_i
# Single thread executor for all network activity.
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.
File cdn_source.rb
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'cocoapods-core/source'
require 'rest'
require 'concurrent'
require 'netrc'
require 'addressable'
Class Lockfile
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class Lockfile
# @todo The symbols should be converted to a String and back to symbol
# when reading (EXTERNAL SOURCES Download options)
# @return [String] the hash used to initialize the Lockfile.
Class Manager
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class Manager
# @return [Pathname] The directory that contains the source repo
# directories.
#
attr_reader :repos_dir
Class Podfile
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class Podfile
# The methods defined in this file and the order of the methods is
# relevant for the documentation generated on
# https://github.com/CocoaPods/guides.cocoapods.org.
Method dependency
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def dependency(*args)
name, *version_requirements = args
if name == self.name
raise Informative, "A specification can't require itself as a " \
'subspec'
- Read upRead up
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 name_for_url
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def name_for_url(url)
base_from_host_and_path = lambda do |host, path|
if host && !host.empty?
domain = PublicSuffix.parse(host) rescue nil
base = [domain&.sld || host]
- Read upRead up
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 download_and_save_with_retries_async
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def download_and_save_with_retries_async(partial_url, file_remote_url, etag, retries = MAX_NUMBER_OF_RETRIES)
path = repo + partial_url
etag_path = path.sub_ext(path.extname + '.etag')
download_task = download_typhoeus_impl_async(file_remote_url, etag).then do |response|
- Read upRead up
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
Class Podfile
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Podfile
# @!group DSL support
include Pod::Podfile::DSL
File dsl.rb
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'cocoapods-core/specification/dsl/attribute_support'
require 'cocoapods-core/specification/dsl/attribute'
require 'cocoapods-core/specification/dsl/platform_proxy'
module Pod
Method initialize
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def initialize(name = nil, *requirements)
if requirements.last.is_a?(Hash)
additional_params = requirements.pop.select { |_, v| !v.nil? }
additional_params = nil if additional_params.empty?
- Read upRead up
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
Class Specification
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Specification
module DSL
# Provides the accessors methods for the root attributes. Root attributes
# do not support multi-platform values and inheritance.
#