Class PBXGroup
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class PBXGroup < AbstractObject
# @!group Attributes
# @return [ObjectList<PBXGroup, PBXFileReference>]
# the objects contained by the group.
Method sort
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def sort(options = nil)
children.sort! do |x, y|
if options && groups_position = options[:groups_position]
raise ArgumentError unless [:above, :below].include?(groups_position)
if x.isa == 'PBXGroup' && !(y.isa == 'PBXGroup')
- 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 sort_by_type
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def sort_by_type
children.sort! do |x, y|
if x.isa == 'PBXGroup' && !(y.isa == 'PBXGroup')
-1
elsif !(x.isa == 'PBXGroup') && y.isa == 'PBXGroup'
- 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 find_subpath
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def find_subpath(path, should_create = false)
return self unless path
path = path.split('/') unless path.is_a?(Array)
child_name = path.shift
child = children.find { |c| c.display_name == child_name }
- 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"