lighttroupe/luz

View on GitHub

Showing 160 of 250 total issues

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

        def with_frame(index=0)
            @image ||= Image.new
            @index ||= 0

            # loop index around on both sides
Severity: Minor
Found in utils/video_file/ffmpeg.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 background_color has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def background_color
        if @object.now?
            if pointer_hovering? || selected?
                BACKGROUND_COLOR_ON_HOVERING
            else
Severity: Minor
Found in gui/gui_event_renderer.rb - About 25 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_recursively has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def render_recursively(user_objects, index=0, &proc)
        uo = user_objects[index]
        return proc.call unless uo

        if uo.usable?
Severity: Minor
Found in engine/engine/engine_rendering.rb - About 25 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_fragment_shader_snippet has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def with_fragment_shader_snippet(snippet, object)
        return yield unless snippet        # allow nil

        index = $fragment_shader_object_stack.count

Severity: Minor
Found in utils/drawing/drawing_shader_snippets.rb - About 25 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 background_color has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def background_color
        if selected?
            if pointer_hovering?
                BACKGROUND_COLOR_SELECTED_AND_HOVERING
            else
Severity: Minor
Found in gui/gui_object.rb - About 25 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def render
        output_variable = output_setting.variable
        return yield unless output_variable

        first_index = $engine.project.variables.index(first_input_setting.variable)
Severity: Minor
Found in engine/plugins/actor_effects/variable-child-router.luz.rb - About 25 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 tick has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def tick
        $engine.with_dmx(channel) { |dmx|
            # This is needed to turn on the light
            dmx.set(1, 245)

Severity: Minor
Found in engine/plugins/director_effects/dmx-martin-mx10-extreme.luz.rb - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    def value
        if $engine.button_pressed_this_frame?(record)
            #
            # Begin Recording
            #
Severity: Minor
Found in engine/plugins/variable_inputs/slider-repeater-measure.luz.rb - About 25 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 load_from_rmagick_image has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def load_from_rmagick_image(image)
        $support_non_power_of_two = Gl.is_available?("ARB_texture_non_power_of_two") if $support_non_power_of_two.nil?

        unless $support_non_power_of_two
            # Ensure powers of two textures
Severity: Minor
Found in utils/image.rb - About 25 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 background_color has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def background_color
        if @object.now?
            if pointer_hovering? || selected?
                BACKGROUND_COLOR_ON_HOVERING
            else
Severity: Minor
Found in gui/gui_event_input_renderer.rb - About 25 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 tick has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def tick
        #
        # Auto-start if this is the first tick
        #
        if (@last_update_frame.nil?) or (@last_update_frame < ($env[:frame_number] - 1))
Severity: Minor
Found in engine/plugins/director_effects/cue-sheet.luz.rb - About 25 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 hide_something! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def hide_something!
        if @directors_menu.visible?
            close_directors_menu!
            default_focus!
            true
Severity: Minor
Found in gui/gui_default.rb - About 25 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 create! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def create!
        # Background
        self << (@background=GuiObject.new.set(:background_image => $engine.load_image('images/enter-exit-popup.png')))

        self << (@enter_value_widget=GuiFloat.new(@object, :enter_value, @object.min, @object.max, digits=2).set(:scale_x => 0.20, :scale_y => 0.8, :float => :left))
Severity: Minor
Found in gui/gui_enter_exit_popup.rb - About 25 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 choose_column_count has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def choose_column_count
        if @grid.count > 49
            8
        elsif @grid.count > 36
            7
Severity: Minor
Found in gui/gui_director_menu.rb - About 25 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_vertex_shader_snippet has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def with_vertex_shader_snippet(snippet, object)
        return yield unless snippet         # allow nil

        index = $vertex_shader_object_stack.count

Severity: Minor
Found in utils/drawing/drawing_shader_snippets.rb - About 25 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_needed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def reload_if_needed
        if file_name != @file_name
            if $engine.project.file_path
                path = File.join($engine.project.file_path, file_name)
                @file = FFmpeg::File.new(path) if File.file?(path)
Severity: Minor
Found in engine/plugins/actor_effects/video.luz.rb - About 25 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 save_pixels_to_path has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def save_pixels_to_path(pixels, output_filepath)
        # Check for presence of raw->png converter app NOTE: only does this once
        @raw_image_encoder_present = !(open("|which #{RAW_IMAGE_ENCODER_NAME}").read.empty?) if @raw_image_encoder_present.nil?

        if @raw_image_encoder_present
Severity: Minor
Found in engine/plugins/project_effects/screen-capture.luz.rb - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    def value
        if $engine.button_down?(button)
            return 1.0 if on_time.instant?
            last_value + ($env[:frame_time_delta] / on_time.to_seconds)
        else
Severity: Minor
Found in engine/plugins/variable_inputs/button.luz.rb - About 25 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 choose_project_path has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def choose_project_path
        @dialog_container << dialog = GuiDirectoryDialog.new('Choose Directory for New project.luz')        # TODO: convert to a save-file-to-directory situation
        dialog.on_closed { dialog.remove_from_parent! }
        dialog.on_selected { |path|
            dialog.remove_from_parent!
Severity: Minor
Found in gui/gui_default.rb - About 25 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 join_vertex_shader_snippet_stack has a Cognitive Complexity of 6 (exceeds 5 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 25 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