lib/glimmer/libui/shape.rb
Class Shape
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Shape
class << self
def exists?(keyword)
keyword = KEYWORD_ALIASES[keyword] || keyword
Shape.constants.include?(constant_symbol(keyword)) and
File shape.rb
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'glimmer/libui/parent'
require 'glimmer/libui/control_proxy/area_proxy'
require 'glimmer/libui/control_proxy/path_proxy'
require 'glimmer/libui/data_bindable'
require 'glimmer/libui/perfect_shaped'
Method method_missing
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
def method_missing(method_name, *args, &block)
method_name_parameter = method_name.to_s.sub(/=$/, '').sub(/^set_/, '').to_sym
if self.class.parameters.include?(method_name_parameter)
method_name = method_name.to_s
parameter_index = self.class.parameters.index(method_name_parameter)
- 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 absolute_point_array
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def absolute_point_array
# TODO Consider moving this method into a module mixed into all shapes having point_array
return unless respond_to?(:point_array)
point_array = self.point_array || []
- 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"