AndyObtiva/glimmer-dsl-libui

View on GitHub

Showing 156 of 312 total issues

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

      def launch(application, ruby_options: [], env_vars: {}, glimmer_options: {})
        ruby_options_string = ruby_options.join(' ') + ' ' if ruby_options.any?
        env_vars = env_vars.merge(glimmer_option_env_vars(glimmer_options))
        load_env_vars(env_vars)
        the_glimmer_lib = glimmer_lib
Severity: Minor
Found in lib/glimmer/launcher.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 create_gui has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def create_gui
    window('Timer') {
      margined true
      
      group('Countdown') {
Severity: Minor
Found in examples/timer.rb - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

                  if ((
                        handle_custom_listener('on_key_event').empty? ||
                        (handle_custom_listener('on_key_event').any? && on_key_event_results.all? {|result| LibUI.boolean_to_integer(result) == 0})
                      ) &&
                      (
    Severity: Critical
    Found in lib/glimmer/libui/control_proxy/area_proxy.rb - About 1 hr to fix

      Method launch has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

        def launch
          window('Contacts', 600, 600) {
            margined true
            
            vertical_box {
      Severity: Minor
      Found in examples/form_table2.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 launch has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

        def launch
          window('Contacts', 600, 600) {
            margined true
            
            vertical_box {
      Severity: Minor
      Found in examples/form_table3.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 launch has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

        def launch
          window('Contacts', 600, 600) {
            margined true
            
            vertical_box {
      Severity: Minor
      Found in examples/form_table.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 launch has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

        def launch
          window('Contacts', 600, 600) {
            margined true
            
            vertical_box {
      Severity: Minor
      Found in examples/form_table4.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 interpret_color has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def interpret_color(value)
              if value.is_a?(Array) && value.last.is_a?(Hash)
                options = value.last
                value = value[0...-1]
              end
      Severity: Minor
      Found in lib/glimmer/libui.rb - About 1 hr to fix

        Method launch has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def launch
            window('histogram example', 640, 480) {
              margined true
              
              horizontal_box {
        Severity: Minor
        Found in examples/histogram.rb - About 1 hr to fix

          Method launch has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def launch
              window('Michael Ende (1929-1995) The Neverending Story', 600, 400) {
                margined true
                
                area {
          Severity: Minor
          Found in examples/basic_draw_text2.rb - About 1 hr to fix

            Method setup_timer has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def setup_timer
                unless @setup_timer
                  Glimmer::LibUI.timer(1) do
                    if @started
                      seconds = @sec_spinbox.value
            Severity: Minor
            Found in examples/timer2.rb - About 1 hr to fix

              Method default_blocks has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def default_blocks
                      case @letter
                      when :I
                        [
                          [block, block, block, block]
              Severity: Minor
              Found in examples/tetris/model/tetromino.rb - About 1 hr to fix

                Method custom_shape_gem has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                        def custom_shape_gem(custom_shape_name, namespace)
                          gem_name = "glimmer-libui-cs-#{custom_shape_name.underscore}"
                          gem_summary = "#{human_name(custom_shape_name)} - Glimmer Custom Shape"
                          if namespace
                            gem_name += "-#{namespace.underscore}"
                Severity: Minor
                Found in lib/glimmer/rake_task/scaffold.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 method_missing has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                      def method_missing(method_name, *args, &block)
                        method_name_parameter = method_name.to_s.sub(/=$/, '').sub(/^set_/, '').to_sym
                        if self.class.parameters.include?(method_name_parameter)
                          method_name = method_name.to_s
                          parameter_index = self.class.parameters.index(method_name_parameter)
                Severity: Minor
                Found in lib/glimmer/libui/shape.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 resizable has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                        def resizable(value = nil)
                          if value.nil?
                            @resizable = true if @resizable.nil?
                            @resizable
                          else
                Severity: Minor
                Found in lib/glimmer/libui/control_proxy/window_proxy.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 launch has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                  def launch
                    window('Michael Ende (1929-1995) The Neverending Story', 600, 500) {
                      margined true
                      
                      vertical_box {
                Severity: Minor
                Found in examples/custom_draw_text2.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 custom_control_gem has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                        def custom_control_gem(custom_control_name, namespace)
                          gem_name = "glimmer-libui-cc-#{custom_control_name.underscore}"
                          gem_summary = "#{human_name(custom_control_name)} - Glimmer Custom Control"
                          if namespace
                            gem_name += "-#{namespace.underscore}"
                Severity: Minor
                Found in lib/glimmer/rake_task/scaffold.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 fill has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                        def fill(*args)
                          args = args.first if args.size == 1 && (args.first.is_a?(Array) || args.first.is_a?(Hash) || args.first.is_a?(String) || args.first.is_a?(Symbol))
                          if args.empty?
                            @fill ||= {}
                          else
                Severity: Minor
                Found in lib/glimmer/libui/control_proxy/path_proxy.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 launch has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                  def launch
                    window('Michael Ende (1929-1995) The Neverending Story', 600, 500) {
                      margined true
                      
                      vertical_box {
                Severity: Minor
                Found in examples/custom_draw_text.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 y has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                        def y(value = nil)
                          if value.nil?
                            @args.size > 3 ? @args[2] : (@options[:y] || 0)
                          else
                            if @args.size > 3
                Severity: Minor
                Found in lib/glimmer/libui/control_proxy/image_proxy.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

                Severity
                Category
                Status
                Source
                Language