Showing 90 of 102 total issues
File manager.rb
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'public_suffix'
module Pod
class Source
class Manager
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'
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)
- 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 update_search_index_if_needed
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def update_search_index_if_needed(changed_spec_paths)
search_index = stored_search_index
return unless search_index
changed_spec_paths.each_pair do |source, spec_paths|
next unless source.indexable?
- 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 _validate_scheme
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def _validate_scheme(s)
unless s.empty?
if consumer.spec.subspec? && consumer.spec.library_specification?
results.add_error('scheme', 'Scheme configuration is not currently supported for subspecs.')
return
- 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 word_list_from_set
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def word_list_from_set(set)
spec = set.specification
word_list = [set.name.dup]
if spec.summary
word_list += spec.summary.split
- 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 dependency
has 45 lines of code (exceeds 25 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'
Method download_and_save_with_retries_async
has 44 lines of code (exceeds 25 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|
Method generate_spec_repos
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def generate_spec_repos(spec_repos)
output = Hash.new {|h, k| h[k] = Array.new(0)}
spec_repos.each do |source, specs|
next unless source
next if specs.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
Method name_for_url
has 40 lines of code (exceeds 25 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]
Method subspec_by_name
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def subspec_by_name(relative_name, raise_if_missing = true, include_non_library_specifications = false)
if relative_name.nil? || relative_name == base_name
self
elsif base_name.nil?
if raise_if_missing
- 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 validate_file_patterns
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def validate_file_patterns
attributes = DSL.attributes.values.select(&:file_patterns?)
attributes.each do |attrb|
patterns = consumer.send(attrb.name)
- 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 store_podspec
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def store_podspec(options = nil)
options ||= {}
unless options.keys.all? { |key| [:name, :path, :subspecs, :subspec].include?(key) }
raise StandardError, 'Unrecognized options for the podspec ' \
"method `#{options}`"
- 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 merge
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def merge(other)
unless name == other.name
raise ArgumentError, "#{self} and #{other} have different names"
end
- 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 get_actual_url
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.get_actual_url(url, user_agent = nil)
redirects = 0
loop do
response = perform_head_request(url, user_agent)
- 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 external_source_description
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def external_source_description(source)
if source.key?(:git)
desc = "`#{source[:git]}`"
desc << ", commit `#{source[:commit]}`" if source[:commit]
desc << ", branch `#{source[:branch]}`" if source[:branch]
- 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 _validate_source
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _validate_source(s)
return unless s.is_a?(Hash)
if git = s[:git]
tag, commit = s.values_at(:tag, :commit)
version = spec.version.to_s
- 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 podspec_path_from_options
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def podspec_path_from_options(options)
if path = options[:path]
if File.basename(path).include?('.podspec')
path_with_ext = path
else
- 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 search_by_name
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def search_by_name(query, full_text_search = false)
query_word_regexps = query.split.map { |word| /#{word}/i }
if full_text_search
query_word_results_hash = {}
updated_search_index.each_value do |word_spec_hash|
- 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 to_hash
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def to_hash
hash = attributes_hash.dup
if root? || available_platforms != parent.available_platforms
platforms = Hash[available_platforms.map { |p| [p.name.to_s, p.deployment_target && p.deployment_target.to_s] }]
hash['platforms'] = platforms
- 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"