CocoaPods/Xcodeproj

View on GitHub

Showing 72 of 74 total issues

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

          def new_xcdatamodeld(group, path, source_tree)
            path = Pathname.new(path)
            ref = group.project.new(XCVersionGroup)
            group.children << ref
            GroupableHelper.set_path_with_source_tree(ref, path, source_tree)
Severity: Minor
Found in lib/xcodeproj/project/object/helpers/file_references_factory.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 dependency_for_target has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def dependency_for_target(target)
          dependencies.find do |dep|
            if dep.target_proxy.remote?
              subproject_reference = project.reference_for_path(target.project.path)
              uuid = subproject_reference.uuid if subproject_reference
Severity: Minor
Found in lib/xcodeproj/project/object/native_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 add_on_demand_resources has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def add_on_demand_resources(on_demand_resource_tag_files)
          on_demand_resource_tag_files.each do |tag, file_refs|
            file_refs.each do |file_ref|
              if resources_build_phase.include?(file_ref)
                existing_build_file = resources_build_phase.build_file(file_ref)
Severity: Minor
Found in lib/xcodeproj/project/object/native_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 platform_name has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def platform_name
          return unless sdk
          if sdk.include? 'iphoneos'
            :ios
          elsif sdk.include? 'macosx'
Severity: Minor
Found in lib/xcodeproj/project/object/native_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 xcodeproj_path has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def xcodeproj_path
      unless @xcodeproj_path
        projects = Dir.glob('*.xcodeproj')
        if projects.size == 1
          xcodeproj_path = projects.first
Severity: Minor
Found in lib/xcodeproj/command.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 configure_with_targets has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def configure_with_targets(runnable_target, test_target, launch_target: false)
      if runnable_target
        add_build_target(runnable_target)
        set_launch_target(runnable_target) if launch_target
      end
Severity: Minor
Found in lib/xcodeproj/scheme.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 attributes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def attributes
            unless @full_attributes
              attributes = @attributes || []
              if superclass.respond_to?(:attributes)
                super_attributes = superclass.attributes
Severity: Minor
Found in lib/xcodeproj/project/object_attributes.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 write_to_path has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def self.write_to_path(hash, path)
      if hash.respond_to?(:to_hash)
        hash = hash.to_hash
      else
        raise TypeError, "The given `#{hash.inspect}` must respond " \
Severity: Minor
Found in lib/xcodeproj/plist.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 move has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def move(object, new_parent)
            unless object
              raise "[Xcodeproj] Attempt to move nil object to `#{new_parent}`."
            end
            unless new_parent
Severity: Minor
Found in lib/xcodeproj/project/object/helpers/groupable_helper.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 sort has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def sort(_options = nil)
          files.sort! do |x, y|
            result = File.basename(x.display_name.downcase, '.*') <=> File.basename(y.display_name.downcase, '.*')
            if result.zero?
              result = File.extname(x.display_name.downcase) <=> File.extname(y.display_name.downcase)
Severity: Minor
Found in lib/xcodeproj/project/object/build_phase.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_system_framework has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def add_system_framework(names)
          Array(names).map do |name|
            case platform_name
            when :ios
              group = project.frameworks_group['iOS'] || project.frameworks_group.new_group('iOS')
Severity: Minor
Found in lib/xcodeproj/project/object/native_target.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 write_element has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def write_element(node, output)
        @indentation = 3
        output << ' ' * @level
        output << "<#{node.expanded_name}"

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