Showing 235 of 401 total issues
File tetromino.rb
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative 'block'
require 'matrix'
class Tetris
Method initialize
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def initialize(parent, *args, swt_transform: nil, multiply: false)
Glimmer::SWT::DisplayProxy.instance.auto_exec do
@parent = parent
@multiply = multiply
if swt_transform.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_observation_request
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle_observation_request(observation_request, source_observation_request: nil, &block)
if observation_request.to_s == 'on_shape_disposed'
@on_shape_disposed_handlers ||= []
@on_shape_disposed_handlers << block
return ShapeListenerProxy.new(shape: self, drawable: drawable, shape_listener_block: block, observation_request: 'on_shape_disposed')
File hello_table.rb
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'glimmer-dsl-swt'
class HelloTable
class BaseballGame
class << self
Method call
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(*args)
options = args.last.is_a?(Hash) ? args.pop : {}
internal_sort = options[:internal_sort] || false
new_model_collection = args.first
Glimmer::SWT::DisplayProxy.instance.auto_exec(override_sync_exec: @model_binding.binding_options[:sync_exec], override_async_exec: @model_binding.binding_options[:async_exec]) do
Class Polygon
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Polygon < Shape
def parameter_names
[:point_array]
end
Method for
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def for(underscored_custom_shape_name)
unless flyweight_custom_shape_classes.keys.include?(underscored_custom_shape_name)
begin
extracted_namespaces = underscored_custom_shape_name.
to_s.
- 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 for
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def for(underscored_custom_widget_name)
unless flyweight_custom_widget_classes.keys.include?(underscored_custom_widget_name)
begin
extracted_namespaces = underscored_custom_widget_name.
to_s.
- 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 custom_shell_gem
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def custom_shell_gem(custom_shell_name, namespace)
gem_name = "glimmer-cs-#{compact_name(custom_shell_name)}"
gem_summary = "#{human_name(custom_shell_name)} - Glimmer Custom Shell"
begin
custom_shell_keyword = dsl_widget_name(custom_shell_name)
- 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 initialize
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def initialize(parent, args)
index = args.delete(args.last) if args.last.is_a?(Numeric)
styles = args.map(&:to_sym)
if !styles.include?(:bar) && !parent.swt_widget.is_a?(Menu)
styles = styles.unshift(:pop_up)
- 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 delegate_observation_request_to_checkboxes
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def delegate_observation_request_to_checkboxes(observation_request, &block)
if observation_request != 'on_widget_disposed'
checkboxes.count.times do |index|
checkbox = checkboxes[index]
label = labels[index]
- 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 configure_sorting
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def configure_sorting
@table_proxy.sort_strategy = lambda do
new_sort = @table_proxy.sort_block || @table_proxy.sort_by_block || @table_proxy.sort_property
new_sort_direction = @table_proxy.sort_direction
return if new_sort == @last_sort && new_sort_direction == @last_sort_direction
- 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 common_app
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def common_app(app_name, shell_type = :app, shell_options = {})
gem_name = file_name(app_name)
gem_summary = human_name(app_name)
return puts("The directory '#{gem_name}' already exists. Please either remove or pick a different name.") if Dir.exist?(gem_name)
system "jruby -S gem install bundler --no-document" if OS.windows? # resolves freezing issue with warbler and bundler 2.2.29 included in JRuby
Method pagination
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def pagination
composite {
layout_data(:fill, :center, true, false)
fill_layout(:horizontal) {
Class BaseballGame
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class BaseballGame
class << self
attr_accessor :selected_game
def all_playoff_games
Class Polyline
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Polyline < Shape
def parameter_names
[:point_array]
end
Method all_playoff_games
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def all_playoff_games
@all_playoff_games ||= {
'NLDS' => [
new(Time.new(2037, 10, 6, 12, 0), 'Chicago Cubs', 'Milwaukee Brewers', 'Free Bobblehead'),
new(Time.new(2037, 10, 7, 12, 0), 'Chicago Cubs', 'Milwaukee Brewers'),
Method games
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def games
if @games.nil?
@games = []
baseball_team_combinations = BaseballTeam.all.combination(2).to_a
current_day = first_day
- 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 edit_tree_item
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def edit_tree_item(tree_item, before_write: nil, after_write: nil, after_cancel: nil)
return if tree_item.nil?
content {
@tree_editor_text_proxy = text {
focus true
Method initialize
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(*args, swt_widget: nil)
auto_exec do
if swt_widget
@swt_widget = swt_widget
else