lib/mittsu/opengl_implementation/materials/material.rb
Method has too many lines. [42/30] Open
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.
Method program_parameters
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Method allocate_shadows
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def allocate_shadows(lights)
max_shadows = 0
lights.each do |light|
next unless light.cast_shadow
- 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
TODO found Open
Open
# MeshDepthMaterial => :depth, # TODO...
- Exclude checks
TODO found Open
Open
# TODO: init_shader for these material-types
- Exclude checks
TODO found Open
Open
# TODO: when SkinnedMesh exists
- Exclude checks
TODO found Open
Open
# MeshNormalMaterial => :normal, # TODO...
- Exclude checks
TODO found Open
Open
# fog_exp: fog.is_a?(FogExp2), # TODO: when FogExp2 exists
- Exclude checks
TODO found Open
Open
# PointCloudMaterial => :particle_basic # TODO...
- Exclude checks
TODO found Open
Open
# LineDashedMaterial => :dashed, # TODO...
- Exclude checks