Showing 659 of 659 total issues
Class has too many lines. [258/250] Open
class Geometry
include OpenGLGeometryLike
attr_accessor :groups, :initted
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
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 has too many lines. [84/30] Open
def create_material(m, texture_path)
# defaults
mtype = 'MeshLambertMaterial'
mpars = {
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [80/30] 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
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [80/30] Open
def make_rotation_from_euler(euler)
te = self.elements
x, y, z = euler.x, euler.y, euler.z
a, b = ::Math.cos(x), ::Math.sin(x)
c, d = ::Math.cos(y), ::Math.sin(y)
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [78/30] Open
def to_json
output = {
metadata: {
version: 4.0,
type: 'BufferGeometry',
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
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
Method has too many lines. [72/30] Open
def set_line_buffers(hint)
if @vertices_need_update
@vertices.each_with_index do |vertex, v|
offset = v * 3
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Cyclomatic complexity for set_mesh_buffers is too high. [48/6] Open
def set_mesh_buffers(object, hint, should_dispose, material)
return unless @initted_arrays
geometry = object.geometry
- Read upRead up
- Exclude checks
This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.
Method has too many lines. [69/30] Open
def init_mesh_buffers(object)
geometry = object.geometry
nvertices = @faces3.length * 3
nvertices2 = nvertices * 2
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [67/30] Open
def set_axis_angle_from_rotation_matrix(m)
# http:#www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm
# assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)
angle, x1, y1, z1 = nil # variables for result
epsilon = 0.01 # margin to allow for rounding errors
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [65/30] Open
def set_particle_buffers(hint)
if @vertices_need_update
@vertices.each_with_index do |vertex, v|
offset = v * 3
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [65/30] Open
def set_from_rotation_matrix(m, order, update = true)
# assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)
te = m.elements
m11 = te[0]; m12 = te[4]; m13 = te[8]
m21 = te[1]; m22 = te[5]; m23 = te[9]
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Class Vector
has 42 methods (exceeds 20 allowed). Consider refactoring. Open
class Vector
attr_accessor :elements, :uv, :index
def initialize(elements)
@elements = elements
Method has too many lines. [64/30] Open
def initialize(radius = 50.0, width_segments = 8, height_segments = 6, phi_start = 0.0, phi_length = (::Math::PI * 2.0), theta_start = 0.0, theta_length = ::Math::PI)
super()
@type = 'SphereGeometry'
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.