CocoaPods/Xcodeproj

View on GitHub
lib/xcodeproj/project.rb

Summary

Maintainability
C
1 day
Test Coverage
A
97%

Class Project has 47 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Project
    include Object

    # @return [Pathname] the path of the project.
    #
Severity: Minor
Found in lib/xcodeproj/project.rb - About 6 hrs to fix

    File project.rb has 330 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'atomos'
    require 'fileutils'
    require 'securerandom'
    
    require 'xcodeproj/project/object'
    Severity: Minor
    Found in lib/xcodeproj/project.rb - About 3 hrs to fix

      Method new_target has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def new_target(type, name, platform, deployment_target = nil, product_group = nil, language = nil, product_basename = nil)
      Severity: Major
      Found in lib/xcodeproj/project.rb - About 50 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 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

        There are no issues that match your filters.

        Category
        Status