lighttroupe/luz

View on GitHub

Showing 160 of 250 total issues

Method gui_render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def gui_render
        with_color(on? ? $gui.view_color : BEAT_OFF_COLOR) {
            with_scale(on? ? ($env[:beat_scale].scale(1.0, 0.9)) : 1.0) {
                with_multiplied_alpha(on? ? ($env[:beat_scale].scale(1.0, 0.0)) : 0.0) {
                    background_image.using {
Severity: Minor
Found in gui/gui_beat_monitor.rb - About 1 hr 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 gui_render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def gui_render
        with_gui_object_properties {
            with_translation(-0.25, 0.0) {
                with_scale(0.5, 1.0) {
                    with_alpha(@object.enable_enter_animation ? 1.0 : 0.4) {
Severity: Minor
Found in gui/gui_enter_exit_button.rb - About 1 hr 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 init_dmx has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def init_dmx
        require 'dmx'

        # TODO: find a better method of finding the device
        @dmx ||= DMX.new("/dev/ttyUSB0", DMX_CHANNEL_COUNT) rescue nil
Severity: Minor
Found in engine/engine/engine_dmx.rb - About 1 hr 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 set_texture_options has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def set_texture_options(options)
        using {
            # TODO: make these based on instance variables and part of Drawing
            GL.TexParameter(GL::TEXTURE_2D, GL::TEXTURE_WRAP_S, options[:repeat] ? GL::REPEAT : GL::CLAMP) #REPEAT)            # REPEAT mode adds noise to the transparent edge of a texture opposite an opaque edge
            GL.TexParameter(GL::TEXTURE_2D, GL::TEXTURE_WRAP_T, options[:repeat] ? GL::REPEAT : GL::CLAMP) #REPEAT)
Severity: Minor
Found in utils/image.rb - About 1 hr 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 run has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def run
        start_time_ms = SDL2.get_ticks
        frame_number = 1

        until finished?
Severity: Minor
Found in utils/sdl_application.rb - About 1 hr 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 join_fragment_shader_snippet_stack has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def join_fragment_shader_snippet_stack(uniforms, snippets, objects)
        return FRAGMENT_SHADER_STUB if snippets.empty?

        #
        # Source code for uniforms declarations at top of shader scripts
Severity: Minor
Found in utils/drawing/drawing_shader_snippets.rb - About 1 hr to fix

    Method render has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def render
            if $env[:hit_test]
                # render nothing when hit testing
                yield
    
    
    Severity: Minor
    Found in engine/plugins/director_effects/camera.luz.rb - About 1 hr to fix

      Method render has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def render
              return yield if amount == 1.0
      
              if amount < 1.0
                  code = "
      Severity: Minor
      Found in engine/plugins/actor_effects/contrast.luz.rb - About 1 hr to fix

        Method load_images has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def load_images(relative_path)
                @images_cache ||= {}
        
                relative_path = relative_path.without_prefix(@project.file_path) if @project.file_path
        
        
        Severity: Minor
        Found in engine/engine/engine_images.rb - About 1 hr to fix

          Method join_vertex_shader_snippet_stack has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def join_vertex_shader_snippet_stack(uniforms, snippets, objects)
                  return VERTEX_SHADER_STUB if snippets.empty?
          
                  #
                  # Source code for uniforms declarations at top of shader scripts
          Severity: Minor
          Found in utils/drawing/drawing_shader_snippets.rb - About 1 hr to fix

            Method run has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def run
                    start_time_ms = SDL2.get_ticks
                    frame_number = 1
            
                    until finished?
            Severity: Minor
            Found in utils/sdl_application.rb - About 1 hr to fix

              Method command_line_options has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def command_line_options
                      OptionParser.new do |opts|
                          opts.banner = "Usage: luz.rb [options] [project.luz]"
              
                          opts.on("--width <width>", Integer, "Resolution width (eg. 800)") do |w|
              Severity: Minor
              Found in luz_performer.rb - About 1 hr to fix

                Method with_pixel_combine_function has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def with_pixel_combine_function(name)
                        return yield unless name
                
                        case name
                        #
                Severity: Minor
                Found in utils/drawing/drawing_color.rb - About 1 hr to fix

                  Method render has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def render
                          return yield if folds == 0.0
                  
                          fold_count = folds.floor
                          folds_doubled = fold_count * 2
                  Severity: Minor
                  Found in engine/plugins/actor_effects/kscope-2.luz.rb - About 1 hr 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 multi_require has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def multi_require(*list)
                          [*list].each { |file|
                              if require(file)
                                  # Grab latest file name (which now includes the .rb) from $LOADED_FEATURES (list of all require'd files)
                                  ext = File.extname($LOADED_FEATURES.last)
                  Severity: Minor
                  Found in utils/reloadable_require.rb - About 1 hr 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 immediate_value has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def immediate_value
                          return @animation_min if @options[:simple]
                  
                          # NOTE: Don't do any value caching here, as we need to resolve in various contexts in a single frame
                          @last_value = @current_value
                  Severity: Minor
                  Found in engine/user_object_settings/user_object_setting_float.rb - About 1 hr 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 on_key_press has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def on_key_press(key)
                          if key == 'down' && !key.control?
                              @actors_list.select_next!
                              @actors_list.scroll_to_selection!
                          elsif key == 'up' && !key.control?
                  Severity: Minor
                  Found in gui/gui_actors_flyout.rb - About 1 hr 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 set_objects has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def set_objects(objects)
                          @objects = objects
                          @objects.each { |object|
                              object.on_clicked {
                                  @objects.each { |o2| o2.animate(:opacity => 0.2) unless object == o2 }        # FX: all but the selected item disappears
                  Severity: Minor
                  Found in gui/gui_list_popup.rb - About 1 hr 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 gui_render_child_conditions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def gui_render_child_conditions
                          if @object.conditions.enable_child_index
                              #@conditions_index_range_label = nil
                              @conditions_index_range_label ||= GuiLabel.new.set(:text_align => :right, :width => 8, :scale_x => 0.45, :scale_y => 0.45, :color => LABEL_CHILD_INDEX_RANGE_COLOR)
                              with_translation(0.25, 0.25) {
                  Severity: Minor
                  Found in gui/gui_child_user_object_renderer.rb - About 1 hr 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 with_watch has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def with_watch(file_path)
                              # Load file
                              if yield
                                  # Add a watch, and when it fires, yield again
                                  $notifier.watch(file_path, :close_write) {
                  Severity: Minor
                  Found in engine/engine/engine_file_monitoring.rb - About 1 hr 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

                  Severity
                  Category
                  Status
                  Source
                  Language