Showing 67 of 251 total issues
Method cache_uniform_locations
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cache_uniform_locations(uniforms, parameters)
identifiers = [
'viewMatrix',
'modelViewMatrix',
'projectionMatrix',
Method init_custom_attributes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def init_custom_attributes(object)
material = object.material
nvertices = @vertices.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 project
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def project(renderer)
puts " --- PROJECT #{self.name}" if DEBUG
@renderer = renderer
return unless visible
init
- 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_buffer
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def render_buffer(camera, lights, fog, material, geometry_group, object)
puts "--- RENDER #{object.name}" if DEBUG
return unless material.visible
geometry_group.renderer = 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 init_geometry_groups
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def init_geometry_groups(object)
material = object.material
add_buffers = false
if @groups.nil? || @groups_need_update
Method allocate_shadows
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def allocate_shadows(lights)
max_shadows = 0
lights.each do |light|
next unless light.cast_shadow
- 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 init
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def init
if !@initted
puts " --- INIT #{self.name}" if DEBUG
@initted = true
- 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 fire_joystick_button_event
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def fire_joystick_button_event(joystick, button, pressed)
if !@joystick_buttons[joystick][button] && pressed
@joystick_button_press_handler.call(joystick, button) unless @joystick_button_press_handler.nil?
elsif @joystick_buttons[joystick][button] && !pressed
@joystick_button_release_handler.call(joystick, button) unless @joystick_button_release_handler.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 set_blending
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_blending(blending, blend_equation = nil, blend_src = nil, blend_dst = nil, blend_equation_alpha = nil, blend_src_alpha = nil, blend_dst_alpha = nil)
Avoid deeply nested control flow statements. Open
if custom_attribute[:bound_to].nil? || custom_attribute[:bound_to] == :vertices
@faces3.each do |chf|
face = obj_faces[chf];
v1 = custom_attribute[:value][face.a]
Method set_parameters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def set_parameters(texture_type, is_image_power_of_two)
if is_image_power_of_two
GL.TexParameteri(texture_type, GL::TEXTURE_WRAP_S, GL::MITTSU_PARAMS[wrap_s])
GL.TexParameteri(texture_type, GL::TEXTURE_WRAP_T, GL::MITTSU_PARAMS[wrap_t])
- 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_buffer
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_buffer(camera, lights, fog, material, geometry_group, update_buffers)
Method render_buffer
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_buffer(camera, lights, fog, material, geometry_group, update_buffers)
Method init_geometry_groups
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def init_geometry_groups(object)
material = object.material
add_buffers = false
if @groups.nil? || @groups_need_update
- 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 @renderer.compressed_texture_formats.include?(gl_format)
GL.CompressedTexImage2D(GL::TEXTURE_CUBE_MAP_POSITIVE_X + i, j, gl_format, mipmap.width, mipmap.height, 0, mipmap.data)
else
puts "WARNING: Mittsu::OpenGLCubeTexture: Attempt to load unsupported compressed texture format in #set"
end
Avoid deeply nested control flow statements. Open
elsif custom_attribute[:size] == 4
if custom_attribute[:bound_to].nil? || custom_attribute[:bound_to] == :vertices
@faces3.each do |chf|
face = obj_faces[chf]
Method render_buffer
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_buffer(camera, lights, fog, material, geometry_group, update_buffers)
Method render_buffer
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_buffer(camera, lights, fog, material, geometry_group, object)
Method update_specific
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update_specific
gl_format = GL::MITTSU_PARAMS[format]
gl_type = GL::MITTSU_PARAMS[type]
mipmaps.each_with_index do |mipmap, 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 render_objects_immediate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_objects_immediate(render_list, material_type, camera, lights, fog, override_material)