Showing 160 of 250 total issues
Method smart_step_value
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def smart_step_value(value, direction)
swapped = false
swapped, value, direction = true, value.abs, ((direction == :up) ? :down : :up) if value < 0.0
# Now we can pretend we're in the positive range going up or down
- 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 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_key_press(key)
if key.control?
if key == 'e'
$engine.view_source(@selected_object) if @selected_object
else
Class GuiUserObjectEditor
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class GuiUserObjectEditor < GuiWindow
attr_accessor :pointer
BACKGROUND_COLOR = [0,0,0,0.95]
Class UserObject
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class UserObject
include MethodsForUserObject
Setting = Struct.new('Setting', :name, :klass, :options)
Method build_editor_for
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def build_editor_for(user_object, options={})
return unless user_object
# extract options
grab_keyboard_focus = options.delete(:grab_keyboard_focus)
- 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 18 (exceeds 5 allowed). Consider refactoring. Open
def on_key_press(key)
if key.control?
if key == 'd'
clone_selected
elsif key == 'e'
- 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
Class GuiList
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class GuiList < GuiBox
VELOCITY_PER_SCROLL = 3.0
MAX_SCROLL_VELOCITY = 16.0
VELOCITY_DAMPER = 0.7 # TODO: setting
Method create!
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create!
@actor_view = GuiActorView.new
@director_view = GuiDirectorView.new
#
Method load_images
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def load_images(relative_path)
@images_cache ||= {}
relative_path = relative_path.without_prefix(@project.file_path) if @project.file_path
- 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 tick
has a Cognitive Complexity of 17 (exceeds 5 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
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
def render(string, font, font_size, width_in_characters, lines, text_align)
#line_spacing = 1.0 # TODO ?
border_left = 0.0
border_top = 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
Class Project
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Project < UserObject
include Callbacks
callback :changed
Method save_project
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def save_project
if $engine.project.path
if $engine.project.save
positive_message 'Project Saved'
yield if block_given?
- 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 16 (exceeds 5 allowed). Consider refactoring. Open
def render!
user_object_try {
if (offscreen_render_actor.present? && !$env[:hit_test])
with_offscreen_buffer { |buffer|
# render scene to offscreen buffer
- 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 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def render(string, font, font_size, width_in_characters, lines, text_align)
#line_spacing = 1.0 # TODO ?
border_left = 0.0
border_top = 0.0
Method render
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def render
return yield if scale == 0.0
actor.one { |a|
parent_user_object.using {
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
def render
total_children = max(number_x.abs + 1, number_y.abs + 1)
for y in (-number_y..number_y)
for x in (-number_x..number_x)
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
def render
return yield if scale == 0.0
actor.one { |a|
parent_user_object.using {
- 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 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_key_press(key)
if key.control?
case key
when 'n'
if key.control?
Method with_compiled_shader
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def with_compiled_shader
return yield if $fragment_shader_snippet_stack.empty? and $vertex_shader_snippet_stack.empty?
$next_texture_number ||= 0
fragment_shader_source = $fragment_shader_snippet_cache[$fragment_shader_snippet_stack]