danini-the-panini/mittsu-opengl

View on GitHub

Showing 251 of 251 total issues

Method has too many lines. [438/30]
Open

    def set_mesh_buffers(object, hint, should_dispose, material)
      return unless @initted_arrays

      geometry = object.geometry

Severity: Minor
Found in lib/mittsu/opengl/geometry_group.rb by rubocop

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 has too many lines. [701/250]
Open

  class OpenGL::Renderer
    attr_accessor :auto_clear, :auto_clear_color, :auto_clear_depth, :auto_clear_stencil, :sort_objects, :gamma_factor, :gamma_input,
      :gamma_output, :shadow_map_enabled, :shadow_map_type, :shadow_map_cull_face, :shadow_map_debug, :shadow_map_cascade,
      :max_morph_targets, :max_morph_normals, :info, :pixel_ratio, :window, :width, :height, :state

Severity: Minor
Found in lib/mittsu/opengl/renderer.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [562/250]
Open

  class OpenGL::GeometryGroup
    include OpenGL::GeometryLike

    attr_reader :id, :material_index

Severity: Minor
Found in lib/mittsu/opengl/geometry_group.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method set_mesh_buffers has 438 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def set_mesh_buffers(object, hint, should_dispose, material)
      return unless @initted_arrays

      geometry = object.geometry

Severity: Major
Found in lib/mittsu/opengl/geometry_group.rb - About 2 days to fix

    File renderer.rb has 729 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'opengl'
    require 'glfw'
    require 'fiddle'
    
    require 'mittsu/opengl/version'
    Severity: Major
    Found in lib/mittsu/opengl/renderer.rb - About 1 day to fix

      Method set_mesh_buffers has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
      Open

          def set_mesh_buffers(object, hint, should_dispose, material)
            return unless @initted_arrays
      
            geometry = object.geometry
      
      
      Severity: Minor
      Found in lib/mittsu/opengl/geometry_group.rb - About 1 day to fix

      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. [120/30]
      Open

          def render(scene, camera)
            return unless @renderer.shadow_map_enabled
      
            lights = []
            fog = nil

      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 Renderer has 77 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class OpenGL::Renderer
          attr_accessor :auto_clear, :auto_clear_color, :auto_clear_depth, :auto_clear_stencil, :sort_objects, :gamma_factor, :gamma_input,
            :gamma_output, :shadow_map_enabled, :shadow_map_type, :shadow_map_cull_face, :shadow_map_debug, :shadow_map_cascade,
            :max_morph_targets, :max_morph_normals, :info, :pixel_ratio, :window, :width, :height, :state
      
      
      Severity: Major
      Found in lib/mittsu/opengl/renderer.rb - About 1 day to fix

        File geometry_group.rb has 567 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'mittsu/opengl/geometry_like'
        
        module Mittsu
          class OpenGL::GeometryGroup
            include OpenGL::GeometryLike
        Severity: Major
        Found in lib/mittsu/opengl/geometry_group.rb - About 1 day to fix

          Method has too many lines. [97/30]
          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
          
          
          Severity: Minor
          Found in lib/mittsu/opengl/renderer.rb by rubocop

          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 has too many lines. [263/250]
          Open

            class ShadowMapPlugin
              def initialize(renderer, lights, opengl_objects, opengl_objects_immediate)
                @renderer, @lights = renderer, lights
                @opengl_objects = opengl_objects
                @opengl_objects_immediate = opengl_objects_immediate

          This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

          Class has too many lines. [258/250]
          Open

            class Geometry
              include OpenGL::GeometryLike
          
              attr_accessor :groups, :initted
          
          

          This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

          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?
          Severity: Minor
          Found in lib/mittsu/opengl_implementation/textures/cube_texture.rb - About 1 day to fix

          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 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
          Severity: Minor
          Found in lib/mittsu/glfw/window.rb - About 6 hrs to fix

          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
          Severity: Minor
          Found in lib/mittsu/opengl/plugins/shadow_map_plugin.rb - About 6 hrs to fix

          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
          
          
          Severity: Minor
          Found in lib/mittsu/opengl/renderer.rb - About 6 hrs to fix

          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 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
          
          
          Severity: Minor
          Found in lib/mittsu/opengl/geometry_group.rb by rubocop

          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. [72/30]
          Open

              def set_line_buffers(hint)
                if @vertices_need_update
                  @vertices.each_with_index do |vertex, v|
                    offset = v * 3
          
          

          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. [69/30]
          Open

              def init_mesh_buffers(object)
                geometry = object.geometry
          
                nvertices = @faces3.length * 3
                nvertices2 = nvertices * 2
          Severity: Minor
          Found in lib/mittsu/opengl/geometry_group.rb by rubocop

          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
          
          

          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.

          Severity
          Category
          Status
          Source
          Language