Showing 156 of 312 total issues
Method launch
has a Cognitive Complexity of 122 (exceeds 5 allowed). Consider refactoring. Open
def launch
window('Area-Based Custom Controls', 385, 385) { |w|
margined true
tab {
- 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 build_control
has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring. Open
def build_control
@model_handler = ::LibUI::FFI::TableModelHandler.malloc
@model_handler.NumColumns = fiddle_closure_block_caller(4) { @columns.map {|c| c.is_a?(DualColumn) ? 2 : (c.is_a?(TripleColumn) ? 3 : 1)}.sum }
@model_handler.ColumnType = fiddle_closure_block_caller(4, [1, 1, 4]) do |_, _, column|
# TODO consider refactoring to use Glimmer::LibUI.enum_symbols(:table_value_type)
- 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
File scaffold.rb
has 631 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'fileutils'
require 'os'
require 'facets/string/titlecase'
# TODO refactor to nest under RakeTask namespace
File table_proxy.rb
has 612 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'glimmer/libui/control_proxy'
require 'glimmer/libui/control_proxy/dual_column'
require 'glimmer/libui/control_proxy/triple_column'
require 'glimmer/data_binding/observer'
require 'glimmer/fiddle_consumer'
Method install_listeners
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def install_listeners
unless @listeners_installed
@area_handler.Draw = fiddle_closure_block_caller(0, [1, 1, 1]) do |_, _, area_draw_params|
area_draw_params = ::LibUI::FFI::AreaDrawParams.new(area_draw_params)
area_draw_params = area_draw_params_hash(area_draw_params)
- 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 setup_timer
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def setup_timer
unless @setup_timer
Glimmer::LibUI.timer(1) do
if @started
seconds = @sec_spinbox.value
- 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 setup_timer
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def setup_timer
unless @setup_timer
Glimmer::LibUI.timer(1) do
if @started
seconds = @sec
- 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
Class TableProxy
has 47 methods (exceeds 20 allowed). Consider refactoring. Open
class TableProxy < ControlProxy
include Glimmer::FiddleConsumer
CUSTOM_LISTENER_NAMES = ['on_changed', 'on_edited']
DEFAULT_COLUMN_SORT_BLOCK = lambda do |table_cell_row, column, table_proxy|
Class ControlProxy
has 46 methods (exceeds 20 allowed). Consider refactoring. Open
class ControlProxy
class << self
def exists?(keyword)
::LibUI.respond_to?("new_#{keyword}") or
::LibUI.respond_to?(keyword) or
Method launch
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def launch
window('Meta-Example', 1000, 500) {
margined true
horizontal_box {
- 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 register_cell_rows_observer
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def register_cell_rows_observer
# TODO update all the each_with_index calls below to work differently when value is an Enumerator
# Perhaps, call ::LibUI.table_model_row_inserted(model, row) not from here, yet from the place where
# we call `next` on the Enumerator to grab more elements
# There will need to be extra intelligence for figuring out when to delete instead of
- 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
Class Shape
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
class Shape
class << self
def exists?(keyword)
keyword = KEYWORD_ALIASES[keyword] || keyword
Shape.constants.include?(constant_symbol(keyword)) and
Method custom_window_file
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
def custom_window_file(custom_window_name, namespace, window_type, window_options = {})
window_options ||= {}
window_options[:custom_window_class_name] ||= 'CustomWindow'
namespace_type = class_name(namespace) == class_name(current_dir_name) ? 'class' : 'module'
Method build_control
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_control
@model_handler = ::LibUI::FFI::TableModelHandler.malloc
@model_handler.NumColumns = fiddle_closure_block_caller(4) { @columns.map {|c| c.is_a?(DualColumn) ? 2 : (c.is_a?(TripleColumn) ? 3 : 1)}.sum }
@model_handler.ColumnType = fiddle_closure_block_caller(4, [1, 1, 4]) do |_, _, column|
# TODO consider refactoring to use Glimmer::LibUI.enum_symbols(:table_value_type)
Method launch
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
def launch
window('Area-Based Custom Controls', 385, 385) { |w|
margined true
tab {
Class Game
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class Game
PLAYFIELD_WIDTH = 10
PLAYFIELD_HEIGHT = 20
PREVIEW_PLAYFIELD_WIDTH = 4
PREVIEW_PLAYFIELD_HEIGHT = 2
File control_proxy.rb
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'glimmer/libui/data_bindable'
require 'glimmer/libui/parent'
module Glimmer
module LibUI
Method launch
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
def launch
window('Michael Ende (1929-1995) The Neverending Story', 600, 500) {
margined true
vertical_box {
Method launch
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
def launch
window('Meta-Example', 1000, 500) {
margined true
horizontal_box {
Method launch
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
def launch
menu('Actions') {
menu_item('Restart') {
on_clicked do
restart_game