CocoaPods/Xcodeproj

View on GitHub

Showing 74 of 74 total issues

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

          def has_one(singular_name, isas)
            isas = [isas] unless isas.is_a?(Array)
            attrb = AbstractObjectAttribute.new(:to_one, singular_name, self)
            attrb.classes = isas
            add_attribute(attrb)
Severity: Minor
Found in lib/xcodeproj/project/object_attributes.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 new_legacy_target has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

      def self.new_legacy_target(project, name, build_tool_path = '/usr/bin/make', build_arguments_string = '$(ACTION)',
                                 build_working_directory = nil, pass_build_settings_in_environment = '1')
Severity: Minor
Found in lib/xcodeproj/project/project_helper.rb - About 45 mins to fix

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

          def self.prepend_parent_path(xml_node, path)
            if !xml_node.parent.nil? && (xml_node.parent.name == 'Group')
              group = GroupReference.from_node(xml_node.parent)
              if !group.location.nil? && !group.location.empty?
                path = '' if path.nil?
    Severity: Minor
    Found in lib/xcodeproj/workspace/reference.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 create_xml_element_with_fallback has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

          def create_xml_element_with_fallback(node, tag_name)
            if node && node.is_a?(REXML::Element)
              raise Informative, 'Wrong XML tag name' unless node.name == tag_name
              @xml_element = node
            else
    Severity: Minor
    Found in lib/xcodeproj/scheme/xml_element_wrapper.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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def initialize(path, skip_initialization = false, object_version = Constants::DEFAULT_OBJECT_VERSION)
          @path = Pathname.new(path).expand_path
          @project_dir = @path.dirname
          @objects_by_uuid = {}
          @generated_uuids = []
    Severity: Minor
    Found in lib/xcodeproj/project.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 hash_from_file_content has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def hash_from_file_content(string)
          hash = {}
          string.split("\n").each do |line|
            uncommented_line = strip_comment(line)
            if include = extract_include(uncommented_line)
    Severity: Minor
    Found in lib/xcodeproj/config.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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

          def initialize(target_or_node = nil, runnable_debugging_mode = nil, bundle_identifier = nil, remote_path = nil)
            create_xml_element_with_fallback(target_or_node, 'RemoteRunnable') do
              self.buildable_reference = BuildableReference.new(target_or_node) if target_or_node
              @xml_element.attributes['runnableDebuggingMode'] = runnable_debugging_mode.to_s if runnable_debugging_mode
              @xml_element.attributes['BundleIdentifier'] = bundle_identifier.to_s if bundle_identifier
    Severity: Minor
    Found in lib/xcodeproj/scheme/remote_runnable.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 convert_to_plist has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

            def self.convert_to_plist(name, type = nil)
              case name
              when :remote_global_id_string
                'remoteGlobalIDString'
              else
    Severity: Minor
    Found in lib/xcodeproj/project/case_converter.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 common_build_settings has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def self.common_build_settings(type, platform = nil, deployment_target = nil, target_product_type = nil, language = :objc)
    Severity: Minor
    Found in lib/xcodeproj/project/project_helper.rb - About 35 mins to fix

      Method configuration_list has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            def self.configuration_list(project, platform = nil, deployment_target = nil, target_product_type = nil, language = nil)
      Severity: Minor
      Found in lib/xcodeproj/project/project_helper.rb - About 35 mins to fix

        Method new_resources_bundle has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

              def self.new_resources_bundle(project, name, platform, product_group, product_basename)
        Severity: Minor
        Found in lib/xcodeproj/project/project_helper.rb - About 35 mins to fix

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

              def parse_sdks_if_needed
                if @needs_to_parse_sdks
                  @versions_by_sdk = {}
                  @versions_by_sdk[:osx] = []
                  @versions_by_sdk[:ios] = []
          Severity: Minor
          Found in lib/xcodeproj/xcodebuild_helper.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 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 parse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def self.parse(flags)
                  result = {
                    :frameworks => [],
                    :weak_frameworks => [],
                    :libraries => [],
          Severity: Minor
          Found in lib/xcodeproj/config/other_linker_flags_parser.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 diff has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def self.diff(value_1, value_2, options = {})
                options[:key_1] ||= 'value_1'
                options[:key_2] ||= 'value_2'
                options[:id_key] ||= nil
          
          
          Severity: Minor
          Found in lib/xcodeproj/differ.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 initialize_from_file has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def initialize_from_file
                pbxproj_path = path + 'project.pbxproj'
                plist = Plist.read_from_path(pbxproj_path.to_s)
                root_object.remove_referrer(self) if root_object
                @root_object     = new_from_plist(plist['rootObject'], plist['objects'], self)
          Severity: Minor
          Found in lib/xcodeproj/project.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 remove_on_demand_resources has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                  def remove_on_demand_resources(on_demand_resource_tag_files)
                    on_demand_resource_tag_files.each do |tag, file_refs|
                      file_refs.each do |file_ref|
                        build_file = resources_build_phase.build_file(file_ref)
                        next if build_file.nil?
          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 initialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def initialize(node_or_argument)
                  create_xml_element_with_fallback(node_or_argument, COMMAND_LINE_ARG_NODE) do
                    raise "Must pass a Hash with 'argument' and 'enabled'!" unless node_or_argument.is_a?(Hash) &&
                        node_or_argument.key?(:argument) && node_or_argument.key?(:enabled)
          
          
          Severity: Minor
          Found in lib/xcodeproj/scheme/command_line_arguments.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