lighttroupe/luz

View on GitHub

Showing 160 of 250 total issues

Method append_from_file has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def append_from_file(file)
        loaded_objects = Syck.load(file)

        raise "version number '#{loaded_objects[:version]}' should be '#{FILE_VERSION}'" unless loaded_objects[:version] == FILE_VERSION

Severity: Minor
Found in engine/project.rb - About 1 hr to fix

    Method on_key_press has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def on_key_press(key)
            return super if key.control?
            case key
            when 'space'
                # ignore
    Severity: Minor
    Found in gui/gui_numeric.rb - About 1 hr to fix

      Method gui_render_styles has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def gui_render_styles
              @object.gui_render_styles_list = GL.RenderCached(@object.gui_render_styles_list) {
                  if @object.effects.size > 8
                      num_rows = 4
                  else
      Severity: Minor
      Found in gui/gui_theme_renderer.rb - About 1 hr to fix

        Method create! has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def create!
                self << @cancel_button = GuiButton.new.set(:scale_x => 0.05, :scale_y => 0.06, :offset_x => -0.475, :offset_y => 0.47, :background_image => $engine.load_image('images/buttons/main-menu-close.png'), :background_image_hover => $engine.load_image('images/buttons/main-menu-close-hover.png'), :background_image_click => $engine.load_image('images/buttons/main-menu-close-click.png'))
                @cancel_button.on_clicked { close_notify }
        
                self << @open_button = GuiButton.new.set(:scale_x => 0.05, :scale_y => 0.06, :offset_x => 0.475, :offset_y => 0.47, :background_image => $engine.load_image('images/buttons/main-menu-open.png'), :background_image_hover => $engine.load_image('images/buttons/main-menu-open-hover.png'), :background_image_click => $engine.load_image('images/buttons/main-menu-open-click.png'))
        Severity: Minor
        Found in gui/gui_main_menu.rb - About 1 hr to fix

          Method decode_io has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def self.decode_io(io, &proc)
                      # Packets start with OSC address
                      address = decode_string(io)
          
                      # Special BUNDLE address
          Severity: Minor
          Found in utils/osc.rb - About 1 hr to fix

            Method tick has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def tick
                    @from_director ||= starting_director.one
                    @to_directors_queue ||= []
            
                    if forwards.now?
            Severity: Minor
            Found in engine/plugins/project_effects/director-to-selected.luz.rb - About 55 mins 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 fill_from_category! has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def fill_from_category!
                    clear_list!
            
                    find_valid_effect_classes.each { |object|
                        next unless (@category.nil? || object.in_category?(@category))
            Severity: Minor
            Found in gui/gui_add_window.rb - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def immediate_value
                    @last_value = @current_value
            
                    # Get raw value, as reported by physical input (MIDI slider, mouse x/y, joystick axis, etc.)
                    v = $engine.slider_value(@slider)
            Severity: Minor
            Found in engine/user_object_settings/user_object_setting_slider.rb - About 55 mins 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_tick has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def gui_tick
                    super
                    if allow_scrolling?
                        starting_scroll = @scroll
            
            
            Severity: Minor
            Found in gui/gui_list.rb - About 55 mins 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_texture_of_previous_frame has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def with_texture_of_previous_frame(number_back)
                    if $previous_frames and $previous_frames.size >= number_back
                        index = $previous_frames_current_frame_index - number_back
                        index += $previous_frames.size if index < 0
                        #puts "chosen index=#{index} which has fbo_id=#{$previous_frames[index]}"
            Severity: Minor
            Found in utils/drawing/drawing_frame_saving.rb - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def on_key_press(key)
                    if key.control?
                        case key
                        when 'n'
                            add_new_director!
            Severity: Minor
            Found in gui/gui_director_menu.rb - About 55 mins 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 arc_to has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def arc_to(center_x, center_y, radius_x, radius_y, radians_start, radians_stop, detail)
            Severity: Major
            Found in utils/path.rb - About 50 mins to fix

              Method from_bgra8_partial has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def from_bgra8_partial(data, data_width, data_height, x, y, width, height)
              Severity: Major
              Found in utils/image.rb - About 50 mins to fix

                Method value has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def value
                        if $engine.button_press_count(button).odd?
                            return 1.0 if on_time.instant? or last_value.nil?
                            return (last_value + ($env[:frame_time_delta] / on_time.to_seconds)).clamp(0.0, 1.0)
                        else
                Severity: Minor
                Found in engine/plugins/variable_inputs/button-toggle.luz.rb - About 45 mins 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

                Avoid deeply nested control flow statements.
                Open

                                    if searching?
                                        @search_label.switch_state({:closed => :open}, duration=0.1)
                                        @category_selector.switch_state({:open => :closed}, duration=0.1)
                                        fill_from_search!
                                    end
                Severity: Major
                Found in gui/gui_add_window.rb - About 45 mins to fix

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

                      def render
                          folds_doubled = folds * 2
                          return yield if folds_doubled == 0
                  
                          # Rotate left half of one slice
                  Severity: Minor
                  Found in engine/plugins/actor_effects/kscope.luz.rb - About 45 mins 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 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def render(string, font, font_size, width_in_characters, lines, text_align)
                  Severity: Minor
                  Found in utils/cairo_font.rb - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        $gui.build_editor_for(renderer.object, :grab_keyboard_focus => true) if renderer
                    Severity: Major
                    Found in gui/gui_variables_flyout.rb - About 45 mins to fix

                      Method respond_to_click has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def respond_to_click
                              show_click_spot        # if highlight_click?
                      
                              #
                              # Pointer capture feature: all clicks go to the "capture object", which can uncapture via return value
                      Severity: Minor
                      Found in gui/pointer.rb - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def gui_render
                              with_gui_object_properties {
                                  if keyboard_focus? && @value_change_in_progress.length > 0
                                      # faint display of current value
                                      with_alpha(0.1) {
                      Severity: Minor
                      Found in gui/gui_numeric.rb - About 45 mins 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