lighttroupe/luz

View on GitHub
gui/pointer.rb

Summary

Maintainability
C
7 hrs
Test Coverage

Class Pointer has 31 methods (exceeds 20 allowed). Consider refactoring.
Open

class Pointer
    easy_accessor :number, :background_image, :color, :size

    include Drawing

Severity: Minor
Found in gui/pointer.rb - About 3 hrs to fix

    Method update_hold has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def update_hold
            @hover_object.click_hold(self) if @hover_object.respond_to?(:click_hold)        # repeated calls once per frame
    
            if dragging?
                update_drag
    Severity: Minor
    Found in gui/pointer.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 is_over has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        def is_over(object)        # NOTE: object is nil if no object
            if @hover_object == object
                # do no work for the common case of "still hovering" (this gets called repeatedly with the same value)
                @drag_out_notify_potential = true
                return
    Severity: Minor
    Found in gui/pointer.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 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

    There are no issues that match your filters.

    Category
    Status