Showing 226 of 659 total issues
Method merge_vertices
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def merge_vertices
vertices_map = {} # Hashmap for looking up vertice by position coordinates (and making sure they are unique)
unique = []; changes = []
precision_points = 4 # number of decimal points, eg. 4 for epsilon of 0.0001
precision = 10 ** precision_points
Method unroll_buffer_material
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def unroll_buffer_material(opengl_object)
object = opengl_object.object
buffer = opengl_object.buffer
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
Method set_line_buffers
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def set_line_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 build_plane
has a Cognitive Complexity of 12 (exceeds 5 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
- 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 make_groups
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def make_groups(uses_face_material = false)
max_vertices_in_group = 65535 # TODO: OES_element_index_uint ???
hash_map = {}
- 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_shadow_camera
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def update_shadow_camera(camera, light)
shadow_camera = light.shadow_camera
points_frustum = light.pointa_frustum
points_world = light.points_world
- 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_values
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def set_values(values = nil)
return if values.nil?
values.each do |(key, new_value)|
if new_value.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 hsl
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def hsl(target = nil)
# h,s,l ranges are in 0.0 - 1.0
hsl = target || { h: 0.0, s: 0.0, l: 0.0 }
rr, gg, bb = self.r, self.g, self.b
max = [r, g, b].max
- 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 compute_morph_normals
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def compute_morph_normals
# save original normals
# - create temp variables on first access
# otherwise just copy (for faster repeated calls)
@_original_face_normal ||= []
- 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 inverse
has 35 lines of code (exceeds 25 allowed). Consider refactoring. 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]
Method create_material
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_material(material_name)
mat = @materials_info[material_name]
params = {
name: material_name,
side: @side
Method initialize
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(mipmaps = nil, width = nil, height = nil, format = RGBAFormat, type = UnsignedByteType, mapping = DEFAULT_MAPPING, wrap_s = ClampToEdgeWrapping, wrap_t = ClampToEdgeWrapping, mag_filter = LinearFilter, min_filter = LinearMipMapLinearFilter, anisotropy = 1)
Method initialize
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(data = nil, width = nil, height = nil, format = RGBAFormat, type = UnsignedByteType, mapping = DEFAULT_MAPPING, wrap_s = ClampToEdgeWrapping, wrap_t = ClampToEdgeWrapping, mag_filter = LinearFilter, min_filter = LinearMipMapLinearFilter, anisotropy = 1)
Method initialize
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(radius = 1.0, detail = 0)
t = (1.0 + ::Math.sqrt(5.0)) / 2.0
r = 1.0 / t
vertices = [
Consider simplifying this complex logical expression. Open
if geometry.vertices_need_update || geometry.morph_targets_need_update || geometry.elements_need_update || geometry.uvs_need_update || geometry.normals_need_update || geometry.colors_need_update || geometry.tangents_need_update || custom_attributes_dirty
geometry_group.set_mesh_buffers(self, GL::DYNAMIC_DRAW, !geometry.dynamic, mat)
end
Method create_virtual_light
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_virtual_light(light, cascade)
DirectionalLight.new.tap do |virtual_light|
virtual_light.is_virtual = true
virtual_light.only_shadow = true
Method to_json
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_json
output = {
metadata: {
version: 4.0,
type: 'BufferGeometry',
Method intersect_box
has 33 lines of code (exceeds 25 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
Method create_texture
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_texture(where, name, source_file, repeat, offset, wrap, anisotropy)
full_path = File.join(texture_path, source_file)
loader = Handlers.get(full_path)
Method set_from_rotation_matrix
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_from_rotation_matrix(m)
# http:#www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm
# 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]