lib/xcodeproj/project.rb
Class Project
has 47 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Project
include Object
# @return [Pathname] the path of the project.
#
File project.rb
has 330 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'atomos'
require 'fileutils'
require 'securerandom'
require 'xcodeproj/project/object'
Method new_target
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def new_target(type, name, platform, deployment_target = nil, product_group = nil, language = nil, product_basename = nil)
Method initialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
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 = []
- Read upRead up
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
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)
- Read upRead up
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"