lighttroupe/luz

View on GitHub

Showing 160 of 250 total issues

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

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

    def on_slider_change(name, value, delayed=false)
        return unless name
        on_new_slider(name)

        # special-case one type of change:
Severity: Minor
Found in engine/engine/engine_sliders.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

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

        def move_to_time(time)
            time += @time_offset
    
            if @last_time
                if time < @last_time
    Severity: Minor
    Found in utils/sample_player.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 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 each_matching_recursive has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def each_matching_recursive(pattern)    # accepts patterns like '*.png'
            each { |filename|
                unless filename == '..' or filename == '.'
                    filepath = File.join(path, filename)
    
    
    Severity: Minor
    Found in utils/addons/dir.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 add_animation has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def add_animation(object, field, target_value, duration, &proc)
    Severity: Minor
    Found in utils/value_animation.rb - About 35 mins to fix

      Method render_to_image has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def render_to_image(string, font, width_in_characters, lines=1, text_align=:left)
      Severity: Minor
      Found in utils/cairo_font.rb - About 35 mins to fix

        Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def initialize(object, method, min, max, digits)
        Severity: Minor
        Found in gui/gui_float.rb - About 35 mins to fix

          Method RoundedRectangle has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def self.RoundedRectangle(radius_x, radius_y, knob_x, knob_y, detail)
          Severity: Minor
          Found in utils/gl_shapes.rb - About 35 mins to fix

            Method with_enter_exit_progress has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def with_enter_exit_progress(value)
                    with_env(:enter, (value < 0.5) ? (value / 0.5) : 1.0) {
                        with_env(:exit, (value > 0.5) ? ((value - 0.5) / 0.5) : 0.0) {
                            yield
                        }
            Severity: Minor
            Found in engine/engine/engine_methods_for_user_object.rb - About 35 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 value has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def value
                    now = Time.now.to_f
                    if @on_until && now < @on_until
                        true
                    else
            Severity: Minor
            Found in engine/plugins/event_inputs/slider-active.luz.rb - About 35 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 pipe has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def pipe(signal, target, original_options={})
                    (signal.respond_to?(:each) ? signal : [signal]).each { |signal|
                        options = {:method => signal}.merge(original_options)
                        if options[:args]
                            module_eval( "def #{signal}(&proc) instance_variable_get('@' + '#{target.to_s}').send('#{options[:method]}', #{options[:args]}, &proc) ; end", "__(METHOD PIPING)__", 1)
            Severity: Minor
            Found in utils/method_piping.rb - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def gui_render
                    with_gui_object_properties {
                        object = get_value
                        if object
                            @current_value_renderer = object.new_renderer if @current_value_renderer.nil? || @current_value_renderer.object != object
            Severity: Minor
            Found in gui/gui_list_select.rb - About 35 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 progress_since has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def progress_since(time, beat=nil)
                    return 1.0 if instant?
            
                    if @time_unit == :beats
                        return 0.0 if beat.nil?
            Severity: Minor
            Found in engine/user_object_settings/user_object_setting_timespan.rb - About 35 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 reload_if_newer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def reload_if_newer(filepath)
                    file = File.new(filepath) rescue nil
                    return false unless file        # no longer exists?
            
                    mtime = file.mtime
            Severity: Minor
            Found in utils/reloadable_require.rb - About 35 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 to_zaml has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def to_zaml(z)
                    z.first_time_only(self) {
                        num = '[-+]?(0x)?\d+\.?\d*'
                        case
                          when self == ''
            Severity: Minor
            Found in utils/zaml.rb - About 35 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 update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def update(max_packets=nil)
                    begin
                        loop {
                            # check readability of socket to avoid generating unnecessary Errno::EAGAIN exceptions
                            return if IO.select(@socket_array, nil, nil, 0).nil?
            Severity: Minor
            Found in utils/osc_server.rb - About 35 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 value has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def value
                    @velocity ||= 0.0
            
                    # add to velocity
                    if slider > 0.0 and slider_setting.last_value == 0.0
            Severity: Minor
            Found in engine/plugins/variable_inputs/slider-impulse.luz.rb - About 35 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 delta_min_max_avg has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def delta_min_max_avg
                    min, max, total = nil, nil, 0.0
            
                    for i in 0..size-2
                        difference = self[i + 1] - self[i]
            Severity: Minor
            Found in utils/addons/array.rb - About 35 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