AndyObtiva/glimmer-dsl-swt

View on GitHub

Showing 401 of 401 total issues

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

            @drawable_on_mouse_move ||= drawable.handle_observation_request('on_mouse_move') do |event|
              if Shape.dragging && Shape.dragged_shape.equal?(self)
                Shape.dragged_shape.move_by((event.x - Shape.dragging_x), (event.y - Shape.dragging_y))
                Shape.dragging_x = event.x
                Shape.dragging_y = event.y
Severity: Minor
Found in lib/glimmer/swt/custom/shape.rb and 1 other location - About 40 mins to fix
lib/glimmer/swt/custom/shape.rb on lines 781..788

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 38.

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 max_height
          max_height_dependencies = [parent.is_a?(Drawable) && parent.size.y, !parent.is_a?(Drawable) && parent.calculated_height]
          if max_height_dependencies != @max_height_dependencies
            # do not repeat calculations
            parent_size_y, parent_calculated_height = @max_height_dependencies = max_height_dependencies
Severity: Minor
Found in lib/glimmer/swt/custom/shape.rb and 1 other location - About 40 mins to fix
lib/glimmer/swt/custom/shape.rb on lines 1291..1298

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 38.

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

            @drawable_on_mouse_move ||= drawable.handle_observation_request('on_mouse_move') do |event|
              if Shape.dragging && Shape.dragged_shape.equal?(self)
                Shape.dragged_shape.move_by((event.x - Shape.dragging_x), (event.y - Shape.dragging_y))
                Shape.dragging_x = event.x
                Shape.dragging_y = event.y
Severity: Minor
Found in lib/glimmer/swt/custom/shape.rb and 1 other location - About 40 mins to fix
lib/glimmer/swt/custom/shape.rb on lines 819..826

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 38.

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 max_width
          max_width_dependencies = [parent.is_a?(Drawable) && parent.size.x, !parent.is_a?(Drawable) && parent.calculated_width]
          if max_width_dependencies != @max_width_dependencies
            # do not repeat calculations
            parent_size_x, parent_calculated_width = @max_width_dependencies = max_width_dependencies
Severity: Minor
Found in lib/glimmer/swt/custom/shape.rb and 1 other location - About 40 mins to fix
lib/glimmer/swt/custom/shape.rb on lines 1301..1308

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 38.

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

Consider simplifying this complex logical expression.
Open

          if (@name != 'text' && @name != 'string' && has_some_background? && !has_some_foreground?) || (@name == 'path' && has_some_background?)
            @options[:fill] = true
          elsif !has_some_background? && has_some_foreground?
            @options[:fill] = false
          elsif @name == 'rectangle' && has_some_background? && has_some_foreground?
Severity: Major
Found in lib/glimmer/swt/custom/shape.rb - About 40 mins to fix

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

            def x_end
              x_end_dependencies = [calculated_width, default_x?, !default_x? && x]
              if x_end_dependencies != @x_end_dependencies
                # avoid recalculation of dependencies
                calculated_width, is_default_x, x = @x_end_dependencies = x_end_dependencies
    Severity: Minor
    Found in lib/glimmer/swt/custom/shape.rb and 1 other location - About 40 mins to fix
    lib/glimmer/swt/custom/shape.rb on lines 1247..1256

    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 37.

    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

          minimum_size BOARD_DIAMETER + AREA_MARGIN + PIECES_AREA_WIDTH + SHELL_MARGIN*2 + (OS.linux? ? 52 : (OS.windows? ? 16 : 0)), BOARD_DIAMETER + 24 + SHELL_MARGIN*2 + (OS.linux? ? 96 : (OS.windows? ? 32 : 0))
    Severity: Minor
    Found in samples/elaborate/quarto.rb and 1 other location - About 40 mins to fix
    samples/elaborate/quarto.rb on lines 87..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 37.

    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 x
                x_dependencies = [bounds.x, parent.is_a?(Shape) && parent.absolute_x]
                if x_dependencies != @x_dependencies
                  # avoid recalculating values
                  bounds_x, parent_absolute_x = @x_dependencies = x_dependencies
    Severity: Minor
    Found in lib/glimmer/swt/custom/shape/polygon.rb and 1 other location - About 40 mins to fix
    lib/glimmer/swt/custom/shape/polygon.rb on lines 134..143

    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 37.

    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 y
                y_dependencies = [bounds.y, parent.is_a?(Shape) && parent.absolute_y]
                if y_dependencies != @y_dependencies
                  # avoid recalculating values
                  bounds_y, parent_absolute_y = @y_dependencies = y_dependencies
    Severity: Minor
    Found in lib/glimmer/swt/custom/shape/polygon.rb and 1 other location - About 40 mins to fix
    lib/glimmer/swt/custom/shape/polygon.rb on lines 121..130

    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 37.

    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 y_end
              y_end_dependencies = [calculated_height, default_y?, !default_y? && y]
              if y_end_dependencies != @y_end_dependencies
                # avoid recalculation of dependencies
                calculated_height, is_default_y, y = @y_end_dependencies = y_end_dependencies
    Severity: Minor
    Found in lib/glimmer/swt/custom/shape.rb and 1 other location - About 40 mins to fix
    lib/glimmer/swt/custom/shape.rb on lines 1234..1243

    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 37.

    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

          maximum_size BOARD_DIAMETER + AREA_MARGIN + PIECES_AREA_WIDTH + SHELL_MARGIN*2 + (OS.linux? ? 52 : (OS.windows? ? 16 : 0)), BOARD_DIAMETER + 24 + SHELL_MARGIN*2 + (OS.linux? ? 96 : (OS.windows? ? 32 : 0))
    Severity: Minor
    Found in samples/elaborate/quarto.rb and 1 other location - About 40 mins to fix
    samples/elaborate/quarto.rb on lines 86..86

    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 37.

    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 update_table_item_properties_from_model has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def update_table_item_properties_from_model(table_item, row_index, column_index, model, model_attribute)
    Severity: Minor
    Found in lib/glimmer/data_binding/table_items_binding.rb - About 35 mins to fix

      Method stick_figure has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def stick_figure(x, y, width, height, &block)
      Severity: Minor
      Found in samples/hello/hello_shape.rb - About 35 mins to fix

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

                    @quad_oval1 = oval {
                      x          <= [@quad, :x1_value, on_read: ->(val) {val - 5}]
                      y          <= [@quad, :y1_value, on_read: ->(val) {val - 5}]
                      width 10
                      height 10
        Severity: Major
        Found in samples/hello/hello_canvas_data_binding.rb and 8 other locations - About 35 mins to fix
        samples/hello/hello_canvas_data_binding.rb on lines 267..273
        samples/hello/hello_canvas_data_binding.rb on lines 275..281
        samples/hello/hello_canvas_data_binding.rb on lines 517..523
        samples/hello/hello_canvas_data_binding.rb on lines 525..531
        samples/hello/hello_canvas_data_binding.rb on lines 792..798
        samples/hello/hello_canvas_data_binding.rb on lines 800..806
        samples/hello/hello_canvas_data_binding.rb on lines 808..814
        samples/hello/hello_canvas_data_binding.rb on lines 816..822

        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 36.

        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 9 locations. Consider refactoring.
        Open

                    @cubic_oval1 = oval {
                      x          <= [@cubic, :x1_value, on_read: ->(val) {val - 5}]
                      y          <= [@cubic, :y1_value, on_read: ->(val) {val - 5}]
                      width 10
                      height 10
        Severity: Major
        Found in samples/hello/hello_canvas_data_binding.rb and 8 other locations - About 35 mins to fix
        samples/hello/hello_canvas_data_binding.rb on lines 267..273
        samples/hello/hello_canvas_data_binding.rb on lines 275..281
        samples/hello/hello_canvas_data_binding.rb on lines 509..515
        samples/hello/hello_canvas_data_binding.rb on lines 517..523
        samples/hello/hello_canvas_data_binding.rb on lines 525..531
        samples/hello/hello_canvas_data_binding.rb on lines 800..806
        samples/hello/hello_canvas_data_binding.rb on lines 808..814
        samples/hello/hello_canvas_data_binding.rb on lines 816..822

        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 36.

        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 9 locations. Consider refactoring.
        Open

                    @quad_oval2 = oval {
                      x          <= [@quad, :cx_value, on_read: ->(val) {val - 5}]
                      y          <= [@quad, :cy_value, on_read: ->(val) {val - 5}]
                      width 10
                      height 10
        Severity: Major
        Found in samples/hello/hello_canvas_data_binding.rb and 8 other locations - About 35 mins to fix
        samples/hello/hello_canvas_data_binding.rb on lines 267..273
        samples/hello/hello_canvas_data_binding.rb on lines 275..281
        samples/hello/hello_canvas_data_binding.rb on lines 509..515
        samples/hello/hello_canvas_data_binding.rb on lines 525..531
        samples/hello/hello_canvas_data_binding.rb on lines 792..798
        samples/hello/hello_canvas_data_binding.rb on lines 800..806
        samples/hello/hello_canvas_data_binding.rb on lines 808..814
        samples/hello/hello_canvas_data_binding.rb on lines 816..822

        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 36.

        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 9 locations. Consider refactoring.
        Open

                    @cubic_oval3 = oval {
                      x          <= [@cubic, :cx2_value, on_read: ->(val) {val - 5}]
                      y          <= [@cubic, :cy2_value, on_read: ->(val) {val - 5}]
                      width 10
                      height 10
        Severity: Major
        Found in samples/hello/hello_canvas_data_binding.rb and 8 other locations - About 35 mins to fix
        samples/hello/hello_canvas_data_binding.rb on lines 267..273
        samples/hello/hello_canvas_data_binding.rb on lines 275..281
        samples/hello/hello_canvas_data_binding.rb on lines 509..515
        samples/hello/hello_canvas_data_binding.rb on lines 517..523
        samples/hello/hello_canvas_data_binding.rb on lines 525..531
        samples/hello/hello_canvas_data_binding.rb on lines 792..798
        samples/hello/hello_canvas_data_binding.rb on lines 800..806
        samples/hello/hello_canvas_data_binding.rb on lines 816..822

        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 36.

        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 interpret(parent, keyword, *args, &block)
                  options = args.last.is_a?(Hash) ? args.pop : {}
                  UI::CustomWidget.for(keyword).new(parent, *args, options, &block).tap do |new_custom_widget|
                    new_custom_widget.body_root.paint_pixel_by_pixel(&block) if block&.parameters&.count == 2
        Severity: Minor
        Found in lib/glimmer/dsl/swt/custom_widget_expression.rb and 1 other location - About 35 mins to fix
        lib/glimmer/dsl/swt/custom_shape_expression.rb on lines 42..45

        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 36.

        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 default_width?
                  return false unless current_parameter_name?(:width)
                  width = self.width
                  (width.nil? || width == :default || width == 'default' || (width.is_a?(Array) && (width.first.to_s == :default || width.first.to_s == 'default')))
        Severity: Minor
        Found in lib/glimmer/swt/custom/shape.rb and 1 other location - About 35 mins to fix
        lib/glimmer/swt/custom/shape.rb on lines 1194..1197

        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 36.

        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 9 locations. Consider refactoring.
        Open

                    @quad_oval3 = oval {
                      x          <= [@quad, :x2_value, on_read: ->(val) {val - 5}]
                      y          <= [@quad, :y2_value, on_read: ->(val) {val - 5}]
                      width 10
                      height 10
        Severity: Major
        Found in samples/hello/hello_canvas_data_binding.rb and 8 other locations - About 35 mins to fix
        samples/hello/hello_canvas_data_binding.rb on lines 267..273
        samples/hello/hello_canvas_data_binding.rb on lines 275..281
        samples/hello/hello_canvas_data_binding.rb on lines 509..515
        samples/hello/hello_canvas_data_binding.rb on lines 517..523
        samples/hello/hello_canvas_data_binding.rb on lines 792..798
        samples/hello/hello_canvas_data_binding.rb on lines 800..806
        samples/hello/hello_canvas_data_binding.rb on lines 808..814
        samples/hello/hello_canvas_data_binding.rb on lines 816..822

        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 36.

        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