CocoaPods/cocoapods-packager

View on GitHub

Showing 12 of 12 total issues

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 initialize has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def initialize(argv)
                @embedded = argv.flag?('embedded')
                @library = argv.flag?('library')
                @dynamic = argv.flag?('dynamic')
                @local = argv.flag?('local', false)
        Severity: Minor
        Found in lib/pod/command/package.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 spec_with_path has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

                def spec_with_path(path)
                  return if path.nil?
                  path = Pathname.new(path)
                  path = Pathname.new(Dir.pwd).join(path) unless path.absolute?
                  return unless path.exist?
          Severity: Minor
          Found in lib/cocoapods-packager/pod_utils.rb - About 45 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 spec_platform has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def spec_platform(platform)
                fwk_base = platform.name.to_s + '/' + framework_path
                spec = <<RB
            s.#{platform.name}.deployment_target    = '#{platform.deployment_target}'
            s.#{platform.name}.vendored_framework   = '#{fwk_base}'
          Severity: Minor
          Found in lib/cocoapods-packager/spec_builder.rb - About 45 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 podfile_from_spec has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                def podfile_from_spec(path, spec_name, platform_name, deployment_target, subspecs, sources)
          Severity: Minor
          Found in lib/cocoapods-packager/pod_utils.rb - About 45 mins to fix

            Method validate! has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                  def validate!
                    super
                    help! 'A podspec name or path is required.' unless @spec
                    help! 'podspec has binary-only depedencies, mangling not possible.' if @mangle && binary_only?(@spec)
                    help! '--bundle-identifier option can only be used for dynamic frameworks' if @bundle_identifier && !@dynamic
            Severity: Minor
            Found in lib/pod/command/package.rb - About 45 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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                    def initialize(argv)
                      @embedded = argv.flag?('embedded')
                      @library = argv.flag?('library')
                      @dynamic = argv.flag?('dynamic')
                      @local = argv.flag?('local', false)
              Severity: Minor
              Found in lib/pod/command/package.rb - About 45 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 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

              Severity
              Category
              Status
              Source
              Language