CocoaPods/cocoapods-packager

View on GitHub
lib/cocoapods-packager/builder.rb

Summary

Maintainability
C
1 day
Test Coverage

Class Builder has 26 methods (exceeds 20 allowed). Consider refactoring.
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
Severity: Minor
Found in lib/cocoapods-packager/builder.rb - About 3 hrs to fix

    File builder.rb has 257 lines of code (exceeds 250 allowed). Consider refactoring.
    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
    Severity: Minor
    Found in lib/cocoapods-packager/builder.rb - About 2 hrs to fix

      Method initialize has 13 arguments (exceeds 4 allowed). Consider refactoring.
      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)
      Severity: Major
      Found in lib/cocoapods-packager/builder.rb - About 1 hr to fix

        Method copy_headers has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        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, '')}` }
        Severity: Minor
        Found in lib/cocoapods-packager/builder.rb - About 55 mins to fix

        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

            def xcodebuild(defines = '', args = '', build_dir = 'build', target = 'Pods-packager', project_root = @static_sandbox_root, config = @config)
        Severity: Minor
        Found in lib/cocoapods-packager/builder.rb - About 45 mins to fix

          Method copy_resources has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          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`
          Severity: Minor
          Found in lib/cocoapods-packager/builder.rb - About 35 mins to fix

          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

          There are no issues that match your filters.

          Category
          Status