Showing 235 of 401 total issues
Method set_attribute
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def set_attribute(attribute_name, *args)
swt_widget_operation = false
result = nil
Glimmer::SWT::DisplayProxy.instance.auto_exec do
result = if proxy_source_object&.respond_to?(attribute_setter(attribute_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 interpret
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def interpret(parent, keyword, *args, &block)
options = args.last.is_a?(Hash) ? args.last : {}
coordinate_args = args.size == (options.empty? ? 2 : 3)
args.unshift(parent) unless parent.nil? || options[:top_level]
@create_pixel_by_pixel = coordinate_args && block&.parameters&.count == 2
- 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 rotate!
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def rotate!(direction)
return if stopped?
can_rotate = nil
new_blocks = nil
game.hypothetical do
- 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 method_missing
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def method_missing(method_name, *args, &block)
dsl_mode = @dsl_mode || args.last.is_a?(Hash) && args.last[:dsl]
if dsl_mode
args.pop if args.last.is_a?(Hash) && args.last[:dsl]
super(method_name, *args, &block)
- 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 config
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def config
project_name = File.basename(File.expand_path('.'))
if !File.exists?('config/warble.rb')
puts 'Generating JAR configuration (config/warble.rb) to use with Warbler...'
FileUtils.mkdir_p('config')
Method place_ship!
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def place_ship!(ship)
begin
old_ship_top_left_cell = ship.top_left_cell
old_ship_orientation = ship.orientation
ship.top_left_cell = self
Method populate_table
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def populate_table(model_collection, parent, column_properties, internal_sort: false)
selected_table_item_models = parent.swt_widget.getSelection.map(&:get_data)
parent.finish_edit!
dispose_start_index = @last_model_collection_attribute_values &&
(model_collection.count < @last_model_collection_attribute_values.count) &&
Method calculate_paint_args!
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def calculate_paint_args!
unless @calculated_paint_args
if @name == 'pixel'
@name = 'point'
# optimized performance calculation for pixel points
Method delegate_observation_request_to_radios
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def delegate_observation_request_to_radios(observation_request, &block)
if observation_request != 'on_widget_disposed'
radios.count.times do |index|
radio = radios[index]
label = labels[index]
Method calculate_points
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def calculate_points
puts "Background calculation activated at zoom #{zoom}" if @background
if @points_calculated
puts "Points calculated already. Returning previously calculated points..."
return @points
Method countdown_group_button_composite
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def countdown_group_button_composite
composite {
row_layout {
margin_width 0
margin_height 0
Method enemy_attack!
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def enemy_attack!
begin
cell = nil
if @enemy_moves.any? && @enemy_moves.last.hit? && !@enemy_moves.last.ship.sunk?
if @enemy_moves[-2].nil? || !@enemy_moves[-2].hit?
Method drag_source=
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def drag_source=(drag_source_value)
deregister_drag_listeners if @drag_and_move
drag_source_old_value = @drag_source
@drag_source = drag_source_value
if @drag_source && !drag_source_old_value
Method apply_shape_arg_conversions!
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def apply_shape_arg_conversions!
if @args.size > 1 && (['polygon', 'polyline'].include?(@name))
@args[0] = @args.dup
@args[1..-1] = []
end
Consider simplifying this complex logical expression. Open
if override_sync_exec || override_sync_exec.nil? && !override_async_exec && sync_exec_required? && Config.auto_sync_exec? && !sync_exec_in_progress? && !async_exec_in_progress?
sync_exec(&block)
elsif override_async_exec || override_async_exec.to_s == 'unless_in_progress' && !async_exec_in_progress?
async_exec(&block)
else
Consider simplifying this complex logical expression. Open
if stopped? or
(start_number != @start_number) or
(frame_count_limited? && @frame_index == @frame_count) or
(cycle_limited? && @cycle_count_index == @cycle_count) or
surpassed_duration_limit?
Consider simplifying this complex logical expression. Open
return @args if parent.is_a?(Drawable) && !default_x? && !default_y? && !default_width? && !default_height? && !max_width? && !max_height?
Method parking_spot
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parking_spot(location_x, location_y, length, angle)
parking_spot_letter = next_parking_spot_letter
height = length
width = (2.0/3)*length
- 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 place_ship!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def place_ship!(ship)
begin
old_ship_top_left_cell = ship.top_left_cell
old_ship_orientation = ship.orientation
ship.top_left_cell = 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 start_event_loop
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def start_event_loop
auto_exec do
until @swt_widget.isDisposed
begin
@display.sleep unless @display.readAndDispatch
- 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"