Showing 235 of 401 total issues
Method inspect
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def inspect(recursive: 1, calculated: false, args: true, properties: true, calculated_args: false)
recurse = recursive == true || recursive.is_a?(Integer) && recursive.to_i > 0
recursive = [recursive -= 1, 0].max if recursive.is_a?(Integer)
args_string = " args=#{@args.inspect}" if args
properties_string = " properties=#{@properties.inspect}}" if properties
- 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 a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def launch(application, jruby_options: [], env_vars: {}, glimmer_options: {})
jruby_options_string = jruby_options.join(' ') + ' ' if jruby_options.any?
env_vars = env_vars.merge(glimmer_option_env_vars(glimmer_options))
env_vars.each do |k,v|
ENV[k] = v
- 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 set_attribute
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_attribute(attribute_name, *args)
options = args.last if args.last.is_a?(Hash)
args.pop if !options.nil? && !options[:redraw].nil?
options ||= {}
perform_redraw = @perform_redraw
Method initialize
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def initialize(*init_args, swt_widget: nil)
auto_exec do
@image_double_buffered = !!(init_args&.last&.include?(:image_double_buffered) && init_args&.last&.delete(:image_double_buffered))
if swt_widget.nil?
underscored_widget_name, parent, args = init_args
- 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 top_left_cell=
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def top_left_cell=(a_cell)
if a_cell
raise "Top left cell #{a_cell} already occupied by ship #{a_cell.ship.name}" if a_cell.ship && a_cell.ship != self
raise "Top left cell #{a_cell} cannot fit ship #{name}" if a_cell.column_index + length > Grid::WIDTH
grid = ship_collection.game.grids[ship_collection.player]
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
def initialize(underscored_layout_name, widget_proxy, args)
DisplayProxy.instance.auto_exec do
@underscored_layout_name = underscored_layout_name
@widget_proxy = widget_proxy
args = SWTProxy.constantify_args(args)
- 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 swt_color
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def swt_color
unless @swt_color
case @args.size
when 1
if @args.first.is_a?(String) || @args.first.is_a?(Symbol)
- 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_checkboxes
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def build_checkboxes
current_selection = selection
@composites.to_a.each(&:dispose)
@checkboxes = []
@labels = []
- 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 draw_frame
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def draw_frame(start_number)
if stopped? or
(start_number != @start_number) or
(frame_count_limited? && @frame_index == @frame_count) or
(cycle_limited? && @cycle_count_index == @cycle_count) or
Method timer_menu_bar
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def timer_menu_bar
menu_bar {
menu {
text '&Action'
Method sort_by_column!
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sort_by_column!(table_column_proxy=nil)
index = nil
auto_exec do
index = swt_widget.columns.to_a.index(table_column_proxy.swt_widget) unless table_column_proxy.nil?
end
Method native
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def native(native_type=nil, native_extra_args)
puts "Generating native executable with jpackage..."
java_version = `jruby -v`
if java_version.include?(JDK_VERSION)
puts "Java Version #{JDK_VERSION} Detected!"
Method build_checkboxes
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_checkboxes
current_selection = selection
@composites.to_a.each(&:dispose)
@checkboxes = []
@labels = []
Method common_app
has a Cognitive Complexity of 13 (exceeds 5 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
- 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 call
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def call(value)
SWT::DisplayProxy.instance.auto_exec(override_sync_exec: @sync_exec, override_async_exec: @async_exec) do
if @widget.respond_to?(:disposed?) && @widget.disposed?
unless @widget.shell_proxy.last_shell_closing?
@widget_proxy.widget_bindings.delete(self)
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
def initialize(widget, property, sync_exec: nil, async_exec: nil)
@widget = widget
@property = property
@sync_exec = sync_exec
@async_exec = async_exec
- 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 evaluate_vertical_win
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def evaluate_vertical_win
connections = nil
last_slot_value = nil
WIDTH.times do |column_index|
connections = 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 normalized_attribute
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def normalized_attribute(attribute_name)
@normalized_attributes ||= {}
if @normalized_attributes[attribute_name].nil?
attribute_name = attribute_name.to_s if attribute_name.is_a?(Symbol)
attribute_name = attribute_name.underscore unless attribute_name.downcase?
- 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 evaluate_diagonal_win
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def evaluate_diagonal_win(diagonal_coordinates)
connections = nil
last_slot_value = nil
diagonal_coordinates.each do |group|
connections = 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 evaluate_horizontal_win
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def evaluate_horizontal_win
connections = nil
last_slot_value = nil
HEIGHT.times do |row_index|
connections = 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"