Showing 250 of 250 total issues
Method with_watch
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def with_watch(file_path)
# Load file
if yield
# Add a watch, and when it fires, yield again
$notifier.watch(file_path, :close_write) {
- 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 multi_require
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def multi_require(*list)
[*list].each { |file|
if require(file)
# Grab latest file name (which now includes the .rb) from $LOADED_FEATURES (list of all require'd files)
ext = File.extname($LOADED_FEATURES.last)
- 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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def render
return yield if folds == 0.0
fold_count = folds.floor
folds_doubled = fold_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 on_key_press
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def on_key_press(key)
if key == 'down' && !key.control?
@actors_list.select_next!
@actors_list.scroll_to_selection!
elsif key == 'up' && !key.control?
- 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_objects
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def set_objects(objects)
@objects = objects
@objects.each { |object|
object.on_clicked {
@objects.each { |o2| o2.animate(:opacity => 0.2) unless object == o2 } # FX: all but the selected item disappears
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
def immediate_value
return @animation_min if @options[:simple]
# NOTE: Don't do any value caching here, as we need to resolve in various contexts in a single frame
@last_value = @current_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 join_fragment_shader_snippet_stack
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def join_fragment_shader_snippet_stack(uniforms, snippets, objects)
return FRAGMENT_SHADER_STUB if snippets.empty?
#
# Source code for uniforms declarations at top of shader scripts
- 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 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_key_press(key)
if key.control?
if key == 'd'
clone_selected
elsif key == 'e'
Method tick_animations!
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def tick_animations!
delete_if { |animation|
# Floating point value animation
progress = ($env[:frame_time] - animation.begin_time) / (animation.end_time - animation.begin_time)
if animation.end_value.is_a? Float
Method generate_character_image
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_character_image(font, character)
puts "generating #{font} #{character}"
image = Image.new
@canvas.using { |context|
Method tick
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def tick
director.one { |dmx_director|
lights = dmx_director.effects
actor.one { |actor_effects|
with_env(:total_children, lights.size) { # this can have an effect on the resulting color set
Method create!
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create!
# Background
self << (@background=GuiObject.new.set(:background_image => $engine.load_image('images/actor-flyout-background.png')))
# Edit director button
Method handle_sdl_event
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle_sdl_event(event)
case event
# Mouse input
when SDL2::Event::MouseMotion
$engine.on_slider_change(MOUSE_1_X, (event.x / (@width - 1).to_f))
Method update_environment
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_environment
beat_scale = @beat_detector.progress # a fuzzy (0.0 to 1.0 inclusive) measure of progress within the current beat
bpm = @beat_detector.beats_per_minute
# Integer beat counts
Method load_file
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def load_file(file_path)
return false unless File.exists? file_path
start_time = Time.now.to_f
Method deep_clone
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def deep_clone(cloned_objects = {}, &is_cloneable_callback)
return cloned_objects[self] if cloned_objects[self]
case self
when Hash
klone = self.clone.clear
Method load_file
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def load_file(file_path)
return false unless File.exists? file_path
start_time = Time.now.to_f
- 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 decode_io
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.decode_io(io, &proc)
# Packets start with OSC address
address = decode_string(io)
# Special BUNDLE address
- 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 after_load
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def after_load
super
# range is the hard limit: we won't return values outside the range
@options[:range] ||= DEFAULT_RANGE
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
def on_key_press(key)
return super if key.control?
case key
when 'space'
# ignore
- 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"