CocoaPods/Xcodeproj

View on GitHub

Showing 74 of 74 total issues

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

          def full_path(object)
            folder =  case object.source_tree
                      when '<group>'
                        object_parent = parent(object)
                        if object_parent.isa == 'PBXProject'.freeze
Severity: Minor
Found in lib/xcodeproj/project/object/helpers/groupable_helper.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 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 clean_hash! has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def self.clean_hash!(hash, key)
      hash.delete(key)
      hash.each do |_, value|
        case value
        when Hash
Severity: Minor
Found in lib/xcodeproj/differ.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 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 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 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 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 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 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 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 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 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 << has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def <<(path_or_reference)
                return unless @document && @document.respond_to?(:root)
          
                case path_or_reference
                when String
          Severity: Minor
          Found in lib/xcodeproj/workspace.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_variable)
                  create_xml_element_with_fallback(node_or_variable, VARIABLE_NODE) do
                    raise "Must pass a Hash with 'key' and 'value'!" unless node_or_variable.is_a?(Hash) &&
                        node_or_variable.key?(:key) && node_or_variable.key?(:value)
          
          
          Severity: Minor
          Found in lib/xcodeproj/scheme/environment_variables.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 to_s has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def to_s
                contents = ''
                stack = []
                @document.root.each_recursive do |elem|
                  until stack.empty?
          Severity: Minor
          Found in lib/xcodeproj/workspace.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 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

          Severity
          Category
          Status
          Source
          Language