Showing 226 of 659 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
Method raycast
has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring. Open
def raycast(raycaster, intersects)
@_inverse_matrix ||= Matrix4.new
@_ray ||= Ray.new
@_sphere ||= Sphere.new
- 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
File opengl_renderer.rb
has 728 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'opengl'
require 'glfw'
require 'fiddle'
require 'mittsu/renderers/opengl/opengl_lib'
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 OpenGLRenderer
has 77 methods (exceeds 20 allowed). Consider refactoring. Open
class OpenGLRenderer
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 opengl_geometry_group.rb
has 567 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'mittsu/renderers/opengl/opengl_geometry_like'
module Mittsu
class OpenGLGeometryGroup
include OpenGLGeometryLike
File matrix4.rb
has 534 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Mittsu
class Matrix4
attr_accessor :elements
DIMENSIONS = 4
File geometry.rb
has 525 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'securerandom'
module Mittsu
class Geometry
include EventDispatcher
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
File buffer_geometry.rb
has 503 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'securerandom'
require 'mittsu/core/event_dispatcher'
module Mittsu
class BufferGeometry
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 raycast
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def raycast(raycaster, intersects)
precision = raycaster.line_precision
precision_sq = precision * precision
@geometry.compute_bounding_sphere if @geometry.bounding_sphere.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 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
Class Vector
has 42 methods (exceeds 20 allowed). Consider refactoring. Open
class Vector
attr_accessor :elements, :uv, :index
def initialize(elements)
@elements = elements
Method raycast
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
def raycast(raycaster, intersects)
@_inverse_matrix ||= Matrix4.new
@_ray ||= Ray.new
@_sphere ||= Sphere.new
Class Object3D
has 41 methods (exceeds 20 allowed). Consider refactoring. Open
class Object3D
include EventDispatcher
attr_accessor :children, :up, :position, :rotation, :quaternion, :scale, :rotation_auto_update, :matrix, :matrix_world, :matrix_auto_update, :matrix_world_needs_update, :visible, :cast_shadow, :receive_shadow, :frustum_culled, :render_order, :user_data, :parent, :geometry
Class Vector3
has 41 methods (exceeds 20 allowed). Consider refactoring. Open
class Vector3 < Vector
ELEMENTS = { x: 0, y: 1, z: 2 }
DIMENSIONS = ELEMENTS.count
def initialize(x = 0, y = 0, z = 0)
Method from_buffer_geometry
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def from_buffer_geometry(geometry)
scope = self
vertices = geometry[:position].array
indices = geometry[:index].nil? ? nil : geometry[:index].array
normals = geometry[:normal].nil? ? nil : geometry[:normal].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 create_material
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def create_material(m, texture_path)
# defaults
mtype = 'MeshLambertMaterial'
mpars = {
- 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"