holywyvern/carbuncle

View on GitHub

Showing 9 of 28 total issues

Class Action has 27 methods (exceeds 20 allowed). Consider refactoring.
Open

    class Action
      attr_reader :controller

      def initialize(controller)
        @controller = controller
Severity: Minor
Found in gems/carbuncle-input/mrblib/input.rb - About 3 hrs to fix

    Method join has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

          def join(*names)
            return '' if names.empty?
    
            names.filter!(&:present?)
            names.map! do |name|
    Severity: Minor
    Found in gems/carbuncle-core/mrblib/file.rb - About 2 hrs 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

    Function Playground has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function Playground() {
      const [value, setValue] = React.useState(exampleGame);
      const [url, setURL] = React.useState(defaultURL);
      const router = useRouter();
      const onHeaderClick = () => {
    Severity: Major
    Found in website/src/pages/playground/index.js - About 2 hrs to fix

      Class Window has 21 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class Window < ::Carbuncle::GUI::Container
            attr_reader :title, :rect, :scroll
            attr_writer :id
            attr_accessor :border, :movable, :scalable, :closable, :minimizable,
                          :disable_scrollbar, :show_title, :auto_scrollbar,
      Severity: Minor
      Found in gems/carbuncle-gui/mrblib/window.rb - About 2 hrs to fix

        Method join has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def join(*names)
                return '' if names.empty?
        
                names.filter!(&:present?)
                names.map! do |name|
        Severity: Minor
        Found in gems/carbuncle-core/mrblib/file.rb - About 1 hr to fix

          Method readlines has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              def readlines(arg1 = nil, arg2 = nil)
                limit, sep = -1, "\n"
                if arg2
                  limit = arg2
                  sep = arg1 || sep
          Severity: Minor
          Found in gems/carbuncle-core/mrblib/file.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 assign_uniform has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def assign_uniform(name, value)
                symbol = name.to_sym
                klass = @uniform_types[symbol]
                unless @uniform_types.key?(symbol)
                  raise ArgumentError, "Uniform '#{name}' does not exists on shader."
          Severity: Minor
          Found in gems/carbuncle-graphics/mrblib/shader.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 update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

                def update(dt)
                  return unless running?
          
                  current_animation = @animations[current]
                  @time += dt
          Severity: Minor
          Found in gems/carbuncle-graphics/mrblib/animated_sprite.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 descendants has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            def descendants
              descendants = []
              ObjectSpace.each_object(singleton_class) do |k|
                next if k.singleton_class?
          
          
          Severity: Minor
          Found in gems/carbuncle-support/mrblib/descendants.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