Method key_difference
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def key_difference(other)
if other.type != type
:project
else
case type
- 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 from_pod_target
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def self.from_pod_target(sandbox, target_by_label, pod_target, is_local_pod: false, checkout_options: nil)
build_settings = {}
build_settings[pod_target.label.to_s] = Hash[pod_target.build_settings.map do |k, v|
[k, Digest::MD5.hexdigest(v.xcconfig.to_s)]
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 from_pod_target
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.from_pod_target(sandbox, target_by_label, pod_target, is_local_pod: false, checkout_options: nil)
build_settings = {}
build_settings[pod_target.label.to_s] = Hash[pod_target.build_settings.map do |k, v|
[k, Digest::MD5.hexdigest(v.xcconfig.to_s)]
end]
Method from_aggregate_target
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.from_aggregate_target(sandbox, target_by_label, aggregate_target)
build_settings = {}
aggregate_target.user_build_configurations.keys.each do |configuration|
build_settings[configuration] = Digest::MD5.hexdigest(aggregate_target.build_settings(configuration).xcconfig.to_s)
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
Avoid too many return
statements within this method. Open
return :project if this_resources != other_resources
Avoid too many return
statements within this method. Open
return :project if this_build_settings != other_build_settings
Avoid too many return
statements within this method. Open
return :project if this_checkout_options != other_checkout_options
Avoid too many return
statements within this method. Open
return :project if this_files != other_files