Method dispose
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def dispose(dispose_images: true, dispose_patterns: true, redraw: true)
Glimmer::SWT::DisplayProxy.instance.auto_exec do
# including classes could override to dispose of resources first
# afterwards, parent removes from its path segments with post_dispose_content
parent.post_dispose_content(self) if parent.is_a?(Path)
- 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 add_to_swt_path
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_to_swt_path(swt_path)
the_path_segment_args = path_segment_args.dup
the_path_segment_args = the_path_segment_args.first if the_path_segment_args.size == 1 && the_path_segment_args.first.is_a?(Array)
if !is_a?(Point) && self.class != Path
if !previous_point_connected?
- 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 add_to_geometry
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_to_geometry(geometry)
the_path_segment_geometry_args = path_segment_geometry_args.dup
if !is_a?(Point) && self.class != Path
if !previous_point_connected?
if the_path_segment_geometry_args.count == default_path_segment_arg_count
- 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"