Showing 65 of 117 total issues
Method launch
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
def launch
@root = root {
title 'Hello, Text!'
width 1280
height 800
- 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 widget_proxy.rb
has 598 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'yaml'
require 'glimmer/data_binding/tk/one_time_observer'
require 'glimmer/tk/widget'
require 'glimmer/tk/draggable_and_droppable'
Class WidgetProxy
has 52 methods (exceeds 20 allowed). Consider refactoring. Open
class WidgetProxy
class << self
def create(keyword, parent, args, &block)
widget_proxy_class(keyword).new(keyword, parent, args, &block)
end
Method launch
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
def launch
@root = root {
title 'Hello, Text!'
width 1280
height 800
File text_proxy.rb
has 368 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'glimmer/tk/widget_proxy'
module Glimmer
module Tk
# Proxy for Tk::Text
Class TextProxy
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class TextProxy < WidgetProxy
ALL_TAG = '__all__'
FORMAT_DEFAULT_MAP = {
'justify' => 'left',
}
Method make_draggable
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def make_draggable
drag_event = nil
bind("<DropAcceptedEvent>", proc { |event| drag_event.drop_accepted = true })
bind("B1-Motion", proc { |tk_event|
if drag_event.nil?
- 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 handle_listener
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def handle_listener(listener_name, &listener)
listener_name = listener_name.to_s
# TODO return a listener registration object that has a deregister method
if listener_name == 'destroy'
# 'destroy' is a more reliable alternative listener binding to '<Destroy>'
- 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 grid
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def grid(options = {})
@_visible = true
options = options.stringify_keys
options['rowspan'] = options.delete('row_span') if options.keys.include?('row_span')
options['columnspan'] = options.delete('column_span') if options.keys.include?('column_span')
- 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 MenuItemProxy
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class MenuItemProxy < WidgetProxy
ACCELERATOR_MODIFIER_EVENT_MAP = {
'Command' => 'Command',
'Cmd' => 'Command',
'Meta' => 'Command',
Class ToplevelProxy
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class ToplevelProxy < WidgetProxy
REGEX_GEOMETRY = /[x+-]/
DEFAULT_WIDTH = 190
DEFAULT_HEIGHT = 0
Method widget_custom_attribute_mapping
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
def widget_custom_attribute_mapping
# TODO consider extracting to modules/subclasses
@widget_custom_attribute_mapping ||= {
::Tk::Tile::TButton => {
'image' => {
Method widget_attribute_listener_installers
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
def widget_attribute_listener_installers
# TODO consider extracting to modules/subclasses
@tk_widget_attribute_listener_installers ||= {
::Tk::Tile::TCheckbutton => {
'variable' => lambda do |observer|
Method launch
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
def launch
root {
title 'Hello, Label!'
notebook {
Method launch
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def launch
root {
title 'Hello, Theme!'
labelframe {
Method launch
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def launch
@root = root {
title 'Glimmer Meta-Sample'
width 1280
height 720
- 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 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
def launch
root {
text 'Hello, Progressbar!'
progressbar {
Method launch
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def launch
@root = root {
title 'Glimmer Meta-Sample'
width 1280
height 720
File hello_text.rb
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'glimmer-dsl-tk'
class HelloText
include Glimmer
Method post_add_content
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def post_add_content
if escapable?
on('KeyPress') do |event|
if event.state == 0 && event.keysym == 'Escape'
tk.grab_release
- 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"