File native_target.rb
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Xcodeproj
class Project
module Object
class AbstractTarget < AbstractObject
# @!group Attributes
Class AbstractTarget
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class AbstractTarget < AbstractObject
# @!group Attributes
# @return [String] The name of the Target.
#
Method resolved_build_setting
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def resolved_build_setting(key, resolve_against_xcconfig = false)
target_settings = build_configuration_list.get_setting(key, resolve_against_xcconfig, self)
project_settings = project.build_configuration_list.get_setting(key, resolve_against_xcconfig)
target_settings.merge(project_settings) do |_key, target_val, proj_val|
target_includes_inherited = Constants::INHERITED_KEYWORDS.any? { |keyword| target_val.include?(keyword) } if target_val
- 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 add_file_references
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def add_file_references(file_references, compiler_flags = {})
file_references.map do |file|
extension = File.extname(file.path).downcase
header_extensions = Constants::HEADER_FILES_EXTENSIONS
is_header_phase = header_extensions.include?(extension)
- 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 add_system_framework
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_system_framework(names)
Array(names).map do |name|
case platform_name
when :ios
group = project.frameworks_group['iOS'] || project.frameworks_group.new_group('iOS')
Method add_dependency
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def add_dependency(target)
unless dependency_for_target(target)
container_proxy = project.new(Xcodeproj::Project::PBXContainerItemProxy)
if target.project == project
container_proxy.container_portal = project.root_object.uuid
- 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_name
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def platform_name
return unless sdk
if sdk.include? 'iphoneos'
:ios
elsif sdk.include? 'macosx'
- 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_for_target
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def dependency_for_target(target)
dependencies.find do |dep|
if dep.target_proxy.remote?
subproject_reference = project.reference_for_path(target.project.path)
uuid = subproject_reference.uuid if subproject_reference
- 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 remove_on_demand_resources
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def remove_on_demand_resources(on_demand_resource_tag_files)
on_demand_resource_tag_files.each do |tag, file_refs|
file_refs.each do |file_ref|
build_file = resources_build_phase.build_file(file_ref)
next if build_file.nil?
- 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 add_on_demand_resources
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def add_on_demand_resources(on_demand_resource_tag_files)
on_demand_resource_tag_files.each do |tag, file_refs|
file_refs.each do |file_ref|
if resources_build_phase.include?(file_ref)
existing_build_file = resources_build_phase.build_file(file_ref)
- 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 add_system_framework
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_system_framework(names)
Array(names).map do |name|
case platform_name
when :ios
group = project.frameworks_group['iOS'] || project.frameworks_group.new_group('iOS')
- 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"