lib/glimmer/swt/custom/shape/polyline.rb
Class Polyline
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Polyline < Shape
def parameter_names
[:point_array]
end
Method absolute_point_array
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def absolute_point_array
point_array = args.size > 1 ? args : self.point_array
if parent.is_a?(Shape)
point_array.each_with_index.map do |coordinate, i|
if i.even?
- 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"