Showing 160 of 250 total issues
Method append_from_file
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def append_from_file(file)
loaded_objects = Syck.load(file)
raise "version number '#{loaded_objects[:version]}' should be '#{FILE_VERSION}'" unless loaded_objects[:version] == FILE_VERSION
Method on_key_press
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_key_press(key)
return super if key.control?
case key
when 'space'
# ignore
Method gui_render_styles
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def gui_render_styles
@object.gui_render_styles_list = GL.RenderCached(@object.gui_render_styles_list) {
if @object.effects.size > 8
num_rows = 4
else
Method create!
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create!
self << @cancel_button = GuiButton.new.set(:scale_x => 0.05, :scale_y => 0.06, :offset_x => -0.475, :offset_y => 0.47, :background_image => $engine.load_image('images/buttons/main-menu-close.png'), :background_image_hover => $engine.load_image('images/buttons/main-menu-close-hover.png'), :background_image_click => $engine.load_image('images/buttons/main-menu-close-click.png'))
@cancel_button.on_clicked { close_notify }
self << @open_button = GuiButton.new.set(:scale_x => 0.05, :scale_y => 0.06, :offset_x => 0.475, :offset_y => 0.47, :background_image => $engine.load_image('images/buttons/main-menu-open.png'), :background_image_hover => $engine.load_image('images/buttons/main-menu-open-hover.png'), :background_image_click => $engine.load_image('images/buttons/main-menu-open-click.png'))
Method decode_io
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.decode_io(io, &proc)
# Packets start with OSC address
address = decode_string(io)
# Special BUNDLE address
Method tick
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def tick
@from_director ||= starting_director.one
@to_directors_queue ||= []
if forwards.now?
- 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 fill_from_category!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def fill_from_category!
clear_list!
find_valid_effect_classes.each { |object|
next unless (@category.nil? || object.in_category?(@category))
- 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 immediate_value
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def immediate_value
@last_value = @current_value
# Get raw value, as reported by physical input (MIDI slider, mouse x/y, joystick axis, etc.)
v = $engine.slider_value(@slider)
- 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 gui_tick
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def gui_tick
super
if allow_scrolling?
starting_scroll = @scroll
- 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 with_texture_of_previous_frame
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def with_texture_of_previous_frame(number_back)
if $previous_frames and $previous_frames.size >= number_back
index = $previous_frames_current_frame_index - number_back
index += $previous_frames.size if index < 0
#puts "chosen index=#{index} which has fbo_id=#{$previous_frames[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 on_key_press
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def on_key_press(key)
if key.control?
case key
when 'n'
add_new_director!
- 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 arc_to
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def arc_to(center_x, center_y, radius_x, radius_y, radians_start, radians_stop, detail)
Method from_bgra8_partial
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def from_bgra8_partial(data, data_width, data_height, x, y, width, height)
Method value
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def value
if $engine.button_press_count(button).odd?
return 1.0 if on_time.instant? or last_value.nil?
return (last_value + ($env[:frame_time_delta] / on_time.to_seconds)).clamp(0.0, 1.0)
else
- 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
Avoid deeply nested control flow statements. Open
if searching?
@search_label.switch_state({:closed => :open}, duration=0.1)
@category_selector.switch_state({:open => :closed}, duration=0.1)
fill_from_search!
end
Method render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def render
folds_doubled = folds * 2
return yield if folds_doubled == 0
# Rotate left half of one slice
- 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 render
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def render(string, font, font_size, width_in_characters, lines, text_align)
Avoid deeply nested control flow statements. Open
$gui.build_editor_for(renderer.object, :grab_keyboard_focus => true) if renderer
Method respond_to_click
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def respond_to_click
show_click_spot # if highlight_click?
#
# Pointer capture feature: all clicks go to the "capture object", which can uncapture via return 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 gui_render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def gui_render
with_gui_object_properties {
if keyboard_focus? && @value_change_in_progress.length > 0
# faint display of current value
with_alpha(0.1) {
- 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"