Showing 93 of 105 total issues
Method versions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def versions(name)
return nil unless specs_dir
raise ArgumentError, 'No name' unless name
fragment = pod_shard_fragment(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 pod_whitelisted_for_configuration?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def pod_whitelisted_for_configuration?(pod_name, configuration_name)
found = false
configuration_pod_whitelist.each do |configuration, pods|
if pods.include?(pod_name)
found = true
- 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 check_required_attributes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_required_attributes
attributes = DSL.attributes.values.select(&:required?)
attributes.each do |attr|
begin
value = spec.send(attr.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 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"
- 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 detect_changes_with_podfile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def detect_changes_with_podfile(podfile)
result = {}
[:added, :changed, :removed, :unchanged].each { |k| result[k] = [] }
installed_deps = {}
- 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 default
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def default(platform = nil)
if platform && multi_platform?
platform_value = ios_default if platform == :ios
platform_value = osx_default if platform == :osx
platform_value || default_value
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def to_hash
hash = ActiveSupport::HashWithIndifferentAccess.new
hash['min'] = @minimum_cocoapods_version.to_s if @minimum_cocoapods_version
hash['max'] = @maximum_cocoapods_version.to_s if @maximum_cocoapods_version
hash['last'] = @latest_cocoapods_version.to_s if @latest_cocoapods_version
- 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 platform
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def platform
name_or_hash = get_hash_value('platform')
if name_or_hash
if name_or_hash.is_a?(Hash)
name = name_or_hash.keys.first.to_sym
- 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_whitelisted_for_configuration?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def dependency_whitelisted_for_configuration?(dependency, configuration)
inherited = -> { root? ? true : parent.dependency_whitelisted_for_configuration?(dependency, configuration) }
return inherited[] unless configuration_whitelist = attributes_hash['configuration_pod_whitelist']
return inherited[] unless whitelist_for_pod = configuration_whitelist[dependency.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 authors
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def authors
authors = attributes_hash['authors']
if authors.is_a?(Hash)
authors
elsif authors.is_a?(Array)
- 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 ensure_bundler!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def ensure_bundler!(version = nil)
unless current_target_definition.root?
raise Informative, 'The Ensure Bundler check can only be set at the root level of the Podfile.'
end
unless %w(BUNDLE_BIN_PATH BUNDLE_GEMFILE).all? { |key| ENV.key?(key) }
- 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 check_attributes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_attributes
attributes_keys = Pod::Specification::DSL.attributes.keys.map(&:to_s)
platform_keys = Specification::DSL::PLATFORMS.map(&:to_s)
valid_keys = attributes_keys + platform_keys + DEPRECATED_KEYS + INTERNAL_KEYS
attributes_hash = consumer.spec.attributes_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 process_array
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def process_array(array)
return '[]' if array.empty?
result = sorted_array(array).map do |array_value|
processed = process_according_to_class(array_value)
- 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 sorted_sets
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sorted_sets(sets, query_word_regexps)
sets.sort_by! do |set|
pre_match_length = nil
found_query_index = nil
found_query_count = 0
- 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_libraries
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _validate_libraries(libs)
libs.each do |lib|
lib = lib.downcase
if lib.end_with?('.a') || lib.end_with?('.dylib')
results.add_error('libraries', 'Libraries should not include the' \
- 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 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?
- 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_dependencies
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def podspec_dependencies
podspecs = get_hash_value('podspecs') || []
podspecs.map do |options|
file = podspec_path_from_options(options)
spec = Specification.from_file(file)
- 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
Avoid too many return
statements within this method. Open
return -1 if lhs.nil?
Avoid too many return
statements within this method. Open
return 1 if rhs.nil?
Avoid too many return
statements within this method. Open
return comparison