Showing 659 of 659 total issues
Method make_rotation_from_euler
has 80 lines of code (exceeds 25 allowed). Consider refactoring. 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)
Method raycast
has 80 lines of code (exceeds 25 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?
Class Quaternion
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Quaternion
EPS = 0.000001
attr_reader :x, :y, :z, :w
Method to_json
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_json
output = {
metadata: {
version: 4.0,
type: 'BufferGeometry',
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 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 to_json
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def to_json
output = {
metadata: {
version: 4.0,
type: 'BufferGeometry',
- 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. [42/30] Open
def initialize(radius = 100.0, tube = 40.0, radial_segments = 8, tubular_segments = 6, arc = (::Math::PI * 2.0))
super()
@type = 'TorusGeometry'
- 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. [42/30] Open
def program_parameters(lights, fog, object)
# heuristics to create shader paramaters according to lights in the scene
# (not to blow over max_lights budget)
max_light_count = allocate_lights(lights)
- 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 intersect_box is too high. [18/6] Open
def intersect_box(box, target = Mittsu::Vector3.new)
# http:#www.scratchapixel.com/lessons/3d-basic-lessons/lesson-7-intersecting-simple-shapes/ray-box-intersection/
invdirx = 1.0 / @direction.x
invdiry = 1.0 / @direction.y
invdirz = 1.0 / @direction.z
- 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.
Cyclomatic complexity for initialize is too high. [18/6] 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
- 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.
Cyclomatic complexity for from_buffer_geometry is too high. [18/6] 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
- 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.
Cyclomatic complexity for set_program is too high. [18/6] 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
- 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.
Class Box3
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class Box3
attr_accessor :min, :max
def initialize(min = nil, max = nil)
@min = min || Mittsu::Vector3.new(Float::INFINITY, Float::INFINITY, Float::INFINITY)
Cyclomatic complexity for raycast is too high. [17/6] 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 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.
Cyclomatic complexity for set is too high. [17/6] Open
def set(slot, renderer)
@renderer = renderer
if image.length == 6
if needs_update?
- 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 intersects_box?
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def intersects_box?(box)
p1 = Mittsu::Vector3.new
p2 = Mittsu::Vector3.new
planes = self.planes
6.times do |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 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 has too many lines. [40/30] Open
def initialize(camera)
@_vector = Vector3.new
@_camera = Camera.new
@geometry = Geometry.new
- 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.