Showing 156 of 312 total issues
Method x
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def x(value = nil)
if value.nil?
@args.size > 3 ? @args[1] : (@options[:x] || 0)
else
if @args.size > 3
- 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 resizable
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def resizable(value = nil)
if value.nil?
@resizable = true if @resizable.nil?
@resizable
else
- 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 launch
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def launch
window('Michael Ende (1929-1995) The Neverending Story', 600, 400) {
margined true
area {
Method setup_timer
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_timer
unless @setup_timer
Glimmer::LibUI.timer(1) do
if @started
seconds = @sec
Method custom_control_gem
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def custom_control_gem(custom_control_name, namespace)
gem_name = "glimmer-libui-cc-#{custom_control_name.underscore}"
gem_summary = "#{human_name(custom_control_name)} - Glimmer Custom Control"
if namespace
gem_name += "-#{namespace.underscore}"
Method custom_shape_gem
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def custom_shape_gem(custom_shape_name, namespace)
gem_name = "glimmer-libui-cs-#{custom_shape_name.underscore}"
gem_summary = "#{human_name(custom_shape_name)} - Glimmer Custom Shape"
if namespace
gem_name += "-#{namespace.underscore}"
Method launch
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def launch
window('Login') {
margined true
vertical_box {
Method launch
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def launch
window('Login') {
margined true
vertical_box {
Method launch
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def launch
window('Login') {
margined true
vertical_box {
Method launch
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def launch
window('Login') {
margined true
vertical_box {
Method send_to_libui
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def send_to_libui(method_name, *args, &block)
if ::LibUI.respond_to?("#{libui_api_keyword}_#{method_name.to_s.sub(/\?$/, '')}") && args.empty?
property = method_name.to_s.sub(/\?$/, '')
value = ::LibUI.send("#{libui_api_keyword}_#{property}", libui, *args)
handle_string_property(property, handle_boolean_property(property, value))
Method init_draw_brush
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def init_draw_brush(draw_brush, draw_brush_args)
if draw_brush_args[:r] || draw_brush_args[:g] || draw_brush_args[:b] || draw_brush_args[:a]
draw_brush_args[:type] ||= :solid
elsif draw_brush_args[:outer_radius]
draw_brush_args[:type] ||= :radial_gradient
Method load_image
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def load_image
require 'chunky_png'
canvas = nil
if file.start_with?('http')
require 'net/http'
- 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 color
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def color(value = nil)
if value.nil?
@red ||= Fiddle::Pointer.malloc(8) # double
@green ||= Fiddle::Pointer.malloc(8) # double
@blue ||= Fiddle::Pointer.malloc(8) # double
- 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 init_draw_brush
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def init_draw_brush(draw_brush, draw_brush_args)
if draw_brush_args[:r] || draw_brush_args[:g] || draw_brush_args[:b] || draw_brush_args[:a]
draw_brush_args[:type] ||= :solid
elsif draw_brush_args[:outer_radius]
draw_brush_args[:type] ||= :radial_gradient
- 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 create_gui
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_gui
menu('Help') {
menu_item('Version') {
on_clicked do
show_version
Method cube
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cube(location_x: 0,
location_y: 0,
rectangle_width: nil,
rectangle_height: nil,
cube_height: nil,
Method launch
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def launch
window('Form') {
margined true
vertical_box {
Method for
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def for(keyword)
unless flyweight_custom_control_classes.keys.include?(keyword)
begin
extracted_namespaces = keyword.
to_s.
Method for
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def for(keyword)
unless flyweight_custom_shape_classes.keys.include?(keyword)
begin
extracted_namespaces = keyword.
to_s.