CocoaPods/CocoaPods

View on GitHub
lib/cocoapods/installer/xcode/pods_project_generator.rb

Summary

Maintainability
B
6 hrs
Test Coverage
A
100%

Method configure_schemes_for_pod_target has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

        def configure_schemes_for_pod_target(project, pod_target, share_scheme, generator_result)
          # Ignore subspecs because they do not provide a scheme configuration due to the fact that they are always
          # merged with the root spec scheme.
          specs = [pod_target.root_spec] + pod_target.test_specs + pod_target.app_specs
          hosted_test_specs_by_host = Hash.new do |hash, key|
Severity: Minor
Found in lib/cocoapods/installer/xcode/pods_project_generator.rb - About 2 hrs 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 configure_schemes_for_pod_target has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def configure_schemes_for_pod_target(project, pod_target, share_scheme, generator_result)
          # Ignore subspecs because they do not provide a scheme configuration due to the fact that they are always
          # merged with the root spec scheme.
          specs = [pod_target.root_spec] + pod_target.test_specs + pod_target.app_specs
          hosted_test_specs_by_host = Hash.new do |hash, key|
Severity: Minor
Found in lib/cocoapods/installer/xcode/pods_project_generator.rb - About 1 hr to fix

    Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            def initialize(sandbox, aggregate_targets, pod_targets, build_configurations, installation_options, config,
                           project_object_version, metadata_cache = nil)
    Severity: Major
    Found in lib/cocoapods/installer/xcode/pods_project_generator.rb - About 1 hr to fix

      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 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

      There are no issues that match your filters.

      Category
      Status