Showing 659 of 659 total issues
Method set
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set(slot, renderer)
@renderer = renderer
if image.length == 6
if needs_update?
Method init_mesh_buffers
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def init_mesh_buffers(object)
geometry = object.geometry
nvertices = @faces3.length * 3
nvertices2 = nvertices * 2
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
def initialize(radius_top = 20.0, radius_bottom = 20.0, height = 100.0, radial_segments = 8, height_segments = 1, open_ended = false, theta_start = 0.0, theta_length = (::Math::PI * 2.0))
super()
@type = 'CylinderGeometry'
- 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
Cyclomatic complexity for create_material is too high. [11/6] Open
def create_material(material_name)
mat = @materials_info[material_name]
params = {
name: material_name,
side: @side
- 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. [35/30] Open
def create_material(material_name)
mat = @materials_info[material_name]
params = {
name: material_name,
side: @side
- 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 update is too high. [11/6] Open
def update
# check all geometry groubs
mat = nil
geometry.groups.each do |geometry_group|
# TODO: place to put this???
- 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. [35/30] Open
def inverse(m, throw_on_invertable = false)
# based on http:#www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm
te = @elements
me = m.elements
n11 = me[0]; n12 = me[4]; n13 = me[8]; n14 = me[12]
- 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 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(func, slices, stacks)
super()
@type = 'ParametricBufferGeometry'
Method initialize
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(width, height, width_segments = 1, height_segments = 1)
super()
@type = 'PlaneBufferGeometry'
Method initialize
has 55 lines of code (exceeds 25 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
Class Geometry
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Geometry
include EventDispatcher
MorphNormal = Struct.new(:face_normals, :vertex_normals)
Normal = Struct.new(:a, :b, :c)
Class BufferGeometry
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class BufferGeometry
include EventDispatcher
DrawCall = Struct.new(:start, :count, :index)
Cyclomatic complexity for render_buffer is too high. [10/6] 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
- 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. [34/30] Open
def initialize(radius = 1.0, detail = 0)
t = (1.0 + ::Math.sqrt(5.0)) / 2.0
r = 1.0 / t
vertices = [
- 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_line_buffers is too high. [10/6] 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 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 parse is too high. [10/6] Open
def parse(text)
lines = text.split("\n")
info = {}
delimiter_pattern = /\s+/
materials_info = {}
- 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 build_plane
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_plane(u, v, udir, vdir, width, height, depth, material_index)
grid_x = @width_segments
grid_y = @height_segments
width_half = width / 2.0
height_half = height / 2.0
Method render_objects_immediate
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def render_objects_immediate(render_list, material_type, camera, lights, fog, override_material)
material = nil
render_list.each do |opengl_object|
object = opengl_object.object
if object.visible
- 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
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def render_objects(render_list, camera, lights, fog, override_material)
material = nil
render_list.each do |opengl_object|
puts "-- RENDER_OBJECT #{opengl_object.name}" if DEBUG
object = opengl_object.object
- 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 intersect_box
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. 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
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"