CocoaPods/CocoaPods

View on GitHub

Showing 281 of 310 total issues

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

      def validate_no_abstract_only_pods!
        @podfile_dependency_cache.target_definition_list.each do |target_definition|
          dependencies = @podfile_dependency_cache.target_definition_dependencies(target_definition)
          next if dependencies.empty?
          next unless target_definition.abstract?
Severity: Minor
Found in lib/cocoapods/installer/podfile_validator.rb - About 1 hr 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 run has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

        def run
          UI.puts
          podspecs_to_lint.each do |podspec|
            validator                = Validator.new(podspec, @source_urls, @platforms)
            validator.local          = true
Severity: Minor
Found in lib/cocoapods/command/lib/lint.rb - About 1 hr 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 validate has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def validate
      @results = []

      # Replace default spec with a subspec if asked for
      a_spec = spec
Severity: Minor
Found in lib/cocoapods/validator.rb - About 1 hr 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 clean_sandbox has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def clean_sandbox
      unless sandbox_state.deleted.empty?
        title_options = { :verbose_prefix => '-> '.red }
        sandbox_state.deleted.each do |pod_name|
          UI.titled_section("Removing #{pod_name}".red, title_options) do
Severity: Minor
Found in lib/cocoapods/installer.rb - About 1 hr 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 add_developer_files has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

          def add_developer_files
            UI.message '- Adding development pod helper files' do
              file_accessors.each do |file_accessor|
                pod_name = file_accessor.spec.name
                next unless sandbox.local?(pod_name)

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 merged_xcconfigs has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

      def merged_xcconfigs(xcconfig_values_by_consumer_by_key, attribute, overriding: {})
        xcconfig_values_by_consumer_by_key.each_with_object(overriding.dup) do |(key, values_by_consumer), xcconfig|
          uniq_values = values_by_consumer.values.uniq
          values_are_bools = uniq_values.all? { |v| v.is_a?(String) && v =~ /\A(yes|no)\z/i }
          if values_are_bools
Severity: Minor
Found in lib/cocoapods/target/build_settings.rb - About 1 hr 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 scope_by_specs has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def scope_by_specs
          root_spec = variants.first.root_spec
          specs = [root_spec]
          specs += if root_spec.default_subspecs.empty?
                     root_spec.subspecs.compact
Severity: Minor
Found in lib/cocoapods/installer/analyzer/pod_variant_set.rb - About 1 hr to fix

    Method add_embed_frameworks_script_phase has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              def add_embed_frameworks_script_phase(native_target, spec)
                script_path = "${PODS_ROOT}/#{target.embed_frameworks_script_path_for_spec(spec).relative_path_from(target.sandbox.root)}"
    
                input_paths_by_config = {}
                output_paths_by_config = {}

      Method run has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              def run
                sources = if @name
                            if File.exist?(@name)
                              [Source.new(Pathname(@name))]
                            else
      Severity: Minor
      Found in lib/cocoapods/command/repo/lint.rb - About 1 hr to fix

        Method perform_extensive_analysis has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def perform_extensive_analysis(spec)
              if spec.non_library_specification?
                error('spec', "Validating a non library spec (`#{spec.name}`) is not supported.")
                return false
              end
        Severity: Minor
        Found in lib/cocoapods/validator.rb - About 1 hr to fix

          Method read_file_system has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

                def read_file_system
                  unless root.exist?
                    raise Informative, "Attempt to read non existent folder `#{root}`."
                  end
                  dirs = []
          Severity: Minor
          Found in lib/cocoapods/sandbox/path_list.rb - About 1 hr 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 sort_dependencies has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def sort_dependencies(dependencies, activated, conflicts)
                dependencies.sort_by! do |dependency|
                  name = name_for(dependency)
                  [
                    activated.vertex_named(name).payload ? 0 : 1,
          Severity: Minor
          Found in lib/cocoapods/resolver.rb - About 1 hr 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 a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def xcodebuild(action, scheme, configuration, deployment_target:)
                require 'fourflusher'
                command = %W(clean #{action} -workspace #{File.join(validation_dir, 'App.xcworkspace')} -scheme #{scheme} -configuration #{configuration})
                case consumer.platform_name
                when :osx, :macos
          Severity: Minor
          Found in lib/cocoapods/validator.rb - About 1 hr 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 add_embed_frameworks_script_phase has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

                    def add_embed_frameworks_script_phase(native_target, spec)
                      script_path = "${PODS_ROOT}/#{target.embed_frameworks_script_path_for_spec(spec).relative_path_from(target.sandbox.root)}"
          
                      input_paths_by_config = {}
                      output_paths_by_config = {}

          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 _ld_runpath_search_paths has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

                def _ld_runpath_search_paths(requires_host_target: false, test_bundle: false, uses_swift: false)
                  paths = []
                  if uses_swift
                    paths << '/usr/lib/swift'
                    paths << '$(PLATFORM_DIR)/Developer/Library/Frameworks' if test_bundle
          Severity: Minor
          Found in lib/cocoapods/target/build_settings.rb - About 1 hr 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 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def xcodebuild(action, scheme, configuration, deployment_target:)
                require 'fourflusher'
                command = %W(clean #{action} -workspace #{File.join(validation_dir, 'App.xcworkspace')} -scheme #{scheme} -configuration #{configuration})
                case consumer.platform_name
                when :osx, :macos
          Severity: Minor
          Found in lib/cocoapods/validator.rb - About 1 hr to fix

            Method relative_glob has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def relative_glob(patterns, options = {})
                    return [] if patterns.empty?
            
                    dir_pattern = options[:dir_pattern]
                    exclude_patterns = options[:exclude_patterns]
            Severity: Minor
            Found in lib/cocoapods/sandbox/path_list.rb - About 1 hr to fix

              Method run has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def run
                      if updates.empty?
                        UI.puts 'No pod updates are available.'.yellow
                      else
                        UI.section 'The color indicates what happens when you run `pod update`' do
              Severity: Minor
              Found in lib/cocoapods/command/outdated.rb - About 1 hr to fix

                Method clean! has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      def clean!
                        UI.message('Cleaning up sandbox directory') do
                          # Clean up Target Support Files Directory
                          target_support_dirs_to_install = (pod_targets + aggregate_targets).map(&:support_files_dir)
                          target_support_dirs = sandbox_target_support_dirs
                Severity: Minor
                Found in lib/cocoapods/installer/sandbox_dir_cleaner.rb - About 1 hr to fix

                  Method install_pod_sources has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def install_pod_sources
                        @downloaded_specs = []
                        @installed_specs = []
                        pods_to_install = sandbox_state.added | sandbox_state.changed
                        title_options = { :verbose_prefix => '-> '.green }
                  Severity: Minor
                  Found in lib/cocoapods/installer.rb - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language