Showing 67 of 251 total issues
Method set_mesh_buffers
has 438 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_mesh_buffers(object, hint, should_dispose, material)
return unless @initted_arrays
geometry = object.geometry
File renderer.rb
has 729 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'opengl'
require 'glfw'
require 'fiddle'
require 'mittsu/opengl/version'
Method set_mesh_buffers
has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring. Open
def set_mesh_buffers(object, hint, should_dispose, material)
return unless @initted_arrays
geometry = object.geometry
- 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 Renderer
has 77 methods (exceeds 20 allowed). Consider refactoring. Open
class OpenGL::Renderer
attr_accessor :auto_clear, :auto_clear_color, :auto_clear_depth, :auto_clear_stencil, :sort_objects, :gamma_factor, :gamma_input,
:gamma_output, :shadow_map_enabled, :shadow_map_type, :shadow_map_cull_face, :shadow_map_debug, :shadow_map_cascade,
:max_morph_targets, :max_morph_normals, :info, :pixel_ratio, :window, :width, :height, :state
File geometry_group.rb
has 567 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'mittsu/opengl/geometry_like'
module Mittsu
class OpenGL::GeometryGroup
include OpenGL::GeometryLike
Method set
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
def set(slot, renderer)
@renderer = renderer
if image.length == 6
if needs_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
Method initialize
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def initialize(width, height, title, antialias: 0)
::GLFW.Init
::GLFW.WindowHint ::GLFW::OPENGL_PROFILE, ::GLFW::OPENGL_CORE_PROFILE
::GLFW.WindowHint ::GLFW::OPENGL_FORWARD_COMPAT, GL::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 render
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def render(scene, camera)
return unless @renderer.shadow_map_enabled
lights = []
fog = 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 load_uniforms_generic
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def load_uniforms_generic(uniforms)
uniforms.each do |(uniform, location)|
# needs_update property is not added to all uniforms.
next if uniform.needs_update == false || location == -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 render
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
def render(scene, camera)
return unless @renderer.shadow_map_enabled
lights = []
fog = nil
Method load_uniforms_generic
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
def load_uniforms_generic(uniforms)
uniforms.each do |(uniform, location)|
# needs_update property is not added to all uniforms.
next if uniform.needs_update == false || location == -1
Method set_program
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def set_program(camera, lights, fog, material, object)
@_used_texture_units = 0
if material.needs_update?
deallocate_material(material) if material.program
- 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 Window
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Window
attr_accessor :key_press_handler, :key_release_handler, :key_repeat_handler, :char_input_handler, :cursor_pos_handler, :mouse_button_press_handler, :mouse_button_release_handler, :scroll_handler, :framebuffer_size_handler
def initialize(width, height, title, antialias: 0)
::GLFW.Init
Method setup_buffers
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def setup_buffers
return unless @framebuffer.nil?
# TODO: when OpenGLRenderTargetCube exists
is_cube = false # render_target.is_a? OpenGLRenderTargetCube
- 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_object
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def update_object(object)
geometry = object.geometry
if geometry.is_a? BufferGeometry
# TODO: geometry vertex array ?????
- 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_particle_buffers
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def set_particle_buffers(hint)
if @vertices_need_update
@vertices.each_with_index do |vertex, v|
offset = v * 3
- 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_line_buffers
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_line_buffers(hint)
if @vertices_need_update
@vertices.each_with_index do |vertex, v|
offset = v * 3
Method init_mesh_buffers
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
def init_mesh_buffers(object)
geometry = object.geometry
nvertices = @faces3.length * 3
nvertices2 = nvertices * 2
Method set_particle_buffers
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_particle_buffers(hint)
if @vertices_need_update
@vertices.each_with_index do |vertex, v|
offset = v * 3
File shadow_map_plugin.rb
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'mittsu/math'
module Mittsu
class ShadowMapPlugin
def initialize(renderer, lights, opengl_objects, opengl_objects_immediate)