AndyObtiva/glimmer-dsl-libui

View on GitHub

Showing 312 of 312 total issues

Method custom_control_gem has 34 lines of code (exceeds 25 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

    Method custom_shape_gem has 34 lines of code (exceeds 25 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

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

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

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

          def launch
            window('Login') {
              margined true
              
              vertical_box {
        Severity: Minor
        Found in examples/login2.rb - About 1 hr to fix

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

            def launch
              window('Login') {
                margined true
                
                vertical_box {
          Severity: Minor
          Found in examples/login3.rb - About 1 hr to fix

            Method send_to_libui has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def send_to_libui(method_name, *args, &block)
                    if ::LibUI.respond_to?("#{libui_api_keyword}_#{method_name.to_s.sub(/\?$/, '')}") && args.empty?
                      property = method_name.to_s.sub(/\?$/, '')
                      value = ::LibUI.send("#{libui_api_keyword}_#{property}", libui, *args)
                      handle_string_property(property, handle_boolean_property(property, value))
            Severity: Minor
            Found in lib/glimmer/libui/control_proxy.rb - About 1 hr to fix

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

                def launch
                  window('Login') {
                    margined true
                    
                    vertical_box {
              Severity: Minor
              Found in examples/login4.rb - About 1 hr to fix

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

                  def launch
                    window('Login') {
                      margined true
                      
                      vertical_box {
                Severity: Minor
                Found in examples/login.rb - About 1 hr to fix

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                  window('Method-Based Custom Controls') {
                    margined true
                    
                    horizontal_box {
                      vertical_box {
                  Severity: Major
                  Found in examples/method_based_custom_controls.rb and 1 other location - About 1 hr to fix
                  examples/method_based_custom_controls2.rb on lines 53..94

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 56.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                  window('Method-Based Custom Controls') {
                    margined true
                    
                    horizontal_box {
                      vertical_box {
                  Severity: Major
                  Found in examples/method_based_custom_controls2.rb and 1 other location - About 1 hr to fix
                  examples/method_based_custom_controls.rb on lines 46..87

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 56.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Method init_draw_brush has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def init_draw_brush(draw_brush, draw_brush_args)
                            if draw_brush_args[:r] || draw_brush_args[:g] || draw_brush_args[:b] || draw_brush_args[:a]
                              draw_brush_args[:type] ||= :solid
                            elsif draw_brush_args[:outer_radius]
                              draw_brush_args[:type] ||= :radial_gradient
                  Severity: Minor
                  Found in lib/glimmer/libui/control_proxy/path_proxy.rb - About 1 hr to fix

                    Method load_image has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                            def load_image
                              require 'chunky_png'
                              canvas = nil
                              if file.start_with?('http')
                                require 'net/http'
                    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

                    Method init_draw_brush has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                            def init_draw_brush(draw_brush, draw_brush_args)
                              if draw_brush_args[:r] || draw_brush_args[:g] || draw_brush_args[:b] || draw_brush_args[:a]
                                draw_brush_args[:type] ||= :solid
                              elsif draw_brush_args[:outer_radius]
                                draw_brush_args[:type] ||= :radial_gradient
                    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 color has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                            def color(value = nil)
                              if value.nil?
                                @red ||= Fiddle::Pointer.malloc(8) # double
                                @green ||= Fiddle::Pointer.malloc(8) # double
                                @blue ||= Fiddle::Pointer.malloc(8) # double
                    Severity: Minor
                    Found in lib/glimmer/libui/control_proxy/color_button_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

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                            def last_cell_row_for(row)
                              # TODO refactor to share code with cell_row_for
                              @cached_last_cell_rows ||= []
                              if @cached_last_cell_rows[row].nil?
                                last_cell_rows = @last_cell_rows || []
                    Severity: Major
                    Found in lib/glimmer/libui/control_proxy/table_proxy.rb and 1 other location - About 1 hr to fix
                    lib/glimmer/libui/control_proxy/table_proxy.rb on lines 373..394

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 55.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 5 locations. Consider refactoring.
                    Open

                            form {
                              stretchy false
                              
                              entry {
                                label 'Name'
                    Severity: Major
                    Found in examples/form_table4.rb and 4 other locations - About 1 hr to fix
                    examples/form_table.rb on lines 25..50
                    examples/form_table2.rb on lines 25..50
                    examples/form_table3.rb on lines 26..51
                    examples/paginated_refined_table.rb on lines 50..75

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 55.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                                vertical_box {
                                  stretchy false
                                  
                                  @zero_or_many_table_selection_checkboxes = @zero_or_many_table_presenter.data.size.times.map do |row|
                                    checkbox("Row #{row} Selection") {
                    Severity: Major
                    Found in examples/basic_table_selection2.rb and 1 other location - About 1 hr to fix
                    examples/basic_table_selection.rb on lines 206..218

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 55.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 5 locations. Consider refactoring.
                    Open

                            form {
                              stretchy false
                              
                              entry {
                                label 'Name'
                    Severity: Major
                    Found in examples/form_table.rb and 4 other locations - About 1 hr to fix
                    examples/form_table2.rb on lines 25..50
                    examples/form_table3.rb on lines 26..51
                    examples/form_table4.rb on lines 23..48
                    examples/paginated_refined_table.rb on lines 50..75

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 55.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                                vertical_box {
                                  stretchy false
                                  
                                  @zero_or_many_table_selection_checkboxes = @zero_or_many_table_presenter.data.size.times.map do |row|
                                    checkbox("Row #{row} Selection") {
                    Severity: Major
                    Found in examples/basic_table_selection.rb and 1 other location - About 1 hr to fix
                    examples/basic_table_selection2.rb on lines 208..220

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 55.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                            def last_last_cell_row_for(row)
                              # TODO refactor to share code with cell_row_for
                              @cached_last_last_cell_rows ||= []
                              if @cached_last_last_cell_rows[row].nil?
                                last_last_cell_rows = @last_last_cell_rows || []
                    Severity: Major
                    Found in lib/glimmer/libui/control_proxy/table_proxy.rb and 1 other location - About 1 hr to fix
                    lib/glimmer/libui/control_proxy/table_proxy.rb on lines 349..370

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 55.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language