Showing 160 of 250 total issues
Avoid deeply nested control flow statements. Open
if searching?
fill_from_search! if @search != search_was
else
end_search!
end
Method render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def render
if method == :below
return yield if (red_cutoff == 0.0 && green_cutoff == 0.0 && blue_cutoff == 0.0 && alpha_cutoff == 0.0)
with_fragment_shader_snippet(BELOW_CODE, 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 on_slider_change
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def on_slider_change(name, value, delayed=false)
return unless name
on_new_slider(name)
# special-case one type of change:
- 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_scene_recursive
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def render_scene_recursive(effect_index = 0, options = {}, &proc)
if (effect_index and effect = effects[effect_index])
if !effect.usable?
render_scene_recursive(effect_index + 1, options, &proc) # Skip this effect
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
Method each_matching_recursive
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def each_matching_recursive(pattern) # accepts patterns like '*.png'
each { |filename|
unless filename == '..' or filename == '.'
filepath = File.join(path, filename)
- 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 move_to_time
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def move_to_time(time)
time += @time_offset
if @last_time
if time < @last_time
- 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 add_animation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_animation(object, field, target_value, duration, &proc)
Method render_to_image
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_to_image(string, font, width_in_characters, lines=1, text_align=:left)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(object, method, min, max, digits)
Method RoundedRectangle
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.RoundedRectangle(radius_x, radius_y, knob_x, knob_y, detail)
Method progress_since
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def progress_since(time, beat=nil)
return 1.0 if instant?
if @time_unit == :beats
return 0.0 if beat.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 value
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def value
now = Time.now.to_f
if @on_until && now < @on_until
true
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
Method pipe
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def pipe(signal, target, original_options={})
(signal.respond_to?(:each) ? signal : [signal]).each { |signal|
options = {:method => signal}.merge(original_options)
if options[:args]
module_eval( "def #{signal}(&proc) instance_variable_get('@' + '#{target.to_s}').send('#{options[:method]}', #{options[:args]}, &proc) ; end", "__(METHOD PIPING)__", 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"
Further reading
Method to_zaml
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def to_zaml(z)
z.first_time_only(self) {
num = '[-+]?(0x)?\d+\.?\d*'
case
when 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 gui_render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def gui_render
with_gui_object_properties {
object = get_value
if object
@current_value_renderer = object.new_renderer if @current_value_renderer.nil? || @current_value_renderer.object != object
- 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 update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update(max_packets=nil)
begin
loop {
# check readability of socket to avoid generating unnecessary Errno::EAGAIN exceptions
return if IO.select(@socket_array, nil, nil, 0).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 with_enter_exit_progress
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def with_enter_exit_progress(value)
with_env(:enter, (value < 0.5) ? (value / 0.5) : 1.0) {
with_env(:exit, (value > 0.5) ? ((value - 0.5) / 0.5) : 0.0) {
yield
}
- 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 delta_min_max_avg
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def delta_min_max_avg
min, max, total = nil, nil, 0.0
for i in 0..size-2
difference = self[i + 1] - self[i]
- 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 value
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def value
@velocity ||= 0.0
# add to velocity
if slider > 0.0 and slider_setting.last_value == 0.0
- 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 reload_if_newer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def reload_if_newer(filepath)
file = File.new(filepath) rescue nil
return false unless file # no longer exists?
mtime = file.mtime
- 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"