CocoaPods/CocoaPods

View on GitHub

Showing 281 of 310 total issues

Method download_request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def self.download_request(request, target)
      result = Response.new
      result.checkout_options = download_source(target, request.params)
      result.location = target

Severity: Minor
Found in lib/cocoapods/downloader.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

Method install_pod_targets has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def install_pod_targets(project, pod_targets)
          umbrella_headers_by_dir = pod_targets.map do |pod_target|
            next unless pod_target.should_build? && pod_target.defines_module?
            pod_target.umbrella_header_path
          end.compact.group_by(&:dirname)
Severity: Minor
Found in lib/cocoapods/installer/xcode/pods_project_generator.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

Method create_module_map has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def create_module_map(native_target)
            return super(native_target) unless custom_module_map

            path = target.module_map_path_to_write
            UI.message "- Copying module map file to #{UI.path(path)}" do

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

        def add_system_framework_dependencies(pod_target_installation_results)
          sorted_installation_results = pod_target_installation_results.sort_by do |pod_target_installation_result|
            pod_target_installation_result.target.name
          end
          sorted_installation_results.each do |target_installation_result|
Severity: Minor
Found in lib/cocoapods/installer/xcode/pods_project_generator.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

Method header_mappings has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def header_mappings(file_accessor, headers)
      consumer = file_accessor.spec_consumer
      header_mappings_dir = consumer.header_mappings_dir
      dir = headers_sandbox
      dir += consumer.header_dir if consumer.header_dir
Severity: Minor
Found in lib/cocoapods/target/pod_target.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

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

          def install!
            UI.message "- Installing target `#{target.name}` #{target.platform}" do
              native_target = add_target
              create_support_files_dir
              create_support_files_group

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

Avoid too many return statements within this method.
Open

          return true if sandbox.predownloaded?(pod)
Severity: Major
Found in lib/cocoapods/installer/analyzer/sandbox_analyzer.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

              return true if folder_empty?(pod)
    Severity: Major
    Found in lib/cocoapods/installer/analyzer/sandbox_analyzer.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return :project if this_resources != other_resources
      Severity: Major
      Found in lib/cocoapods/installer/project_cache/target_cache_key.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return :project if this_build_settings != other_build_settings
        Severity: Major
        Found in lib/cocoapods/installer/project_cache/target_cache_key.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return :project if this_checkout_options != other_checkout_options
          Severity: Major
          Found in lib/cocoapods/installer/project_cache/target_cache_key.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return :project if this_files != other_files
            Severity: Major
            Found in lib/cocoapods/installer/project_cache/target_cache_key.rb - About 30 mins to fix

              Method initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def initialize(use_user_settings = true)
                    configure_with(DEFAULTS)
              
                    unless ENV['CP_HOME_DIR'].nil?
                      @cache_root = home_dir + 'cache'
              Severity: Minor
              Found in lib/cocoapods/config.rb - About 25 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 cocoapods_sha has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def self.cocoapods_sha
                    return unless gemspec = Gem.loaded_specs['cocoapods']
                    return unless source = gemspec.source
                    return unless source.respond_to?(:revision)
                    source.revision
              Severity: Minor
              Found in lib/cocoapods/version_metadata.rb - About 25 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 add_build_configuration has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def add_build_configuration(name, type)
                    build_configuration = super
                    settings = build_configuration.build_settings
                    definitions = settings['GCC_PREPROCESSOR_DEFINITIONS'] || ['$(inherited)']
                    defines = [defininition_for_build_configuration(name)]
              Severity: Minor
              Found in lib/cocoapods/project.rb - About 25 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 requirement_satisfied_by? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def requirement_satisfied_by?(requirement, activated, spec)
                    version = spec.version
                    return false unless requirement.requirement.satisfied_by?(version)
                    return false unless valid_possibility_version_for_root_name?(requirement, activated, spec)
                    return false unless spec_is_platform_compatible?(activated, requirement, spec)
              Severity: Minor
              Found in lib/cocoapods/resolver.rb - About 25 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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                      def run
                        UI.puts("$CACHE_ROOT: #{@cache.root}") if @short_output
                        if @pod_name.nil? # Print all
                          @cache.cache_descriptors_per_pod.each do |pod_name, cache_descriptors|
                            print_pod_cache_infos(pod_name, cache_descriptors)
              Severity: Minor
              Found in lib/cocoapods/command/cache/list.rb - About 25 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 execute_command has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def self.execute_command(executable, command, raise_on_failure = true)
                    bin = which!(executable)
              
                    command = command.map(&:to_s)
                    if File.basename(bin) == 'tar.exe'
              Severity: Minor
              Found in lib/cocoapods/executable.rb - About 25 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 get_path_of_spec has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                    def get_path_of_spec(spec, version_filter = false)
                      sets = config.sources_manager.search_by_name(spec)
              
                      if sets.count == 1
                        set = sets.first
              Severity: Minor
              Found in lib/cocoapods/command/spec.rb - About 25 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 add_copy_resources_script_phase has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                      def add_copy_resources_script_phase
                        unless target.includes_resources?
                          native_targets.each do |native_target|
                            TargetIntegrator.remove_copy_resources_script_phase_from_target(native_target)
                          end
              Severity: Minor
              Found in lib/cocoapods/installer/user_project_integrator/target_integrator.rb - About 25 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