lib/cocoapods-packager/builder.rb
Class Builder
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Builder
def initialize(platform, static_installer, source_dir, static_sandbox_root, dynamic_sandbox_root, public_headers_root, spec, embedded, mangle, dynamic, config, bundle_identifier, exclude_deps)
@platform = platform
@static_installer = static_installer
@source_dir = source_dir
File builder.rb
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module Pod
class Builder
def initialize(platform, static_installer, source_dir, static_sandbox_root, dynamic_sandbox_root, public_headers_root, spec, embedded, mangle, dynamic, config, bundle_identifier, exclude_deps)
@platform = platform
@static_installer = static_installer
Method initialize
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def initialize(platform, static_installer, source_dir, static_sandbox_root, dynamic_sandbox_root, public_headers_root, spec, embedded, mangle, dynamic, config, bundle_identifier, exclude_deps)
Method copy_headers
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def copy_headers
headers_source_root = "#{@public_headers_root}/#{@spec.name}"
Dir.glob("#{headers_source_root}/**/*.h").
each { |h| `ditto #{h} #{@fwk.headers_path}/#{h.sub(headers_source_root, '')}` }
- 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 xcodebuild
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def xcodebuild(defines = '', args = '', build_dir = 'build', target = 'Pods-packager', project_root = @static_sandbox_root, config = @config)
Method copy_resources
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def copy_resources
bundles = Dir.glob("#{@static_sandbox_root}/build/*.bundle")
if @dynamic
resources_path = "ios/#{@spec.name}.framework"
`cp -rp #{@static_sandbox_root}/build/*.bundle #{resources_path} 2>&1`
- 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"