AndyObtiva/glimmer-dsl-swt

View on GitHub
lib/glimmer/swt/widget_proxy.rb

Summary

Maintainability
F
1 wk
Test Coverage
B
82%

File widget_proxy.rb has 1044 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'glimmer/swt/widget_listener_proxy'
require 'glimmer/swt/color_proxy'
require 'glimmer/swt/font_proxy'
require 'glimmer/swt/swt_proxy'
require 'glimmer/swt/display_proxy'
Severity: Major
Found in lib/glimmer/swt/widget_proxy.rb - About 2 days to fix

    Class WidgetProxy has 62 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class WidgetProxy
          include Packages
          include ProxyProperties
          include Custom::Drawable
    
    
    Severity: Major
    Found in lib/glimmer/swt/widget_proxy.rb - About 1 day to fix

      Method widget_property_listener_installers has 221 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def widget_property_listener_installers
              @swt_widget_property_listener_installers ||= {
                Java::OrgEclipseSwtWidgets::Control => {
                  :focus => lambda do |observer|
                    on_focus_gained { |focus_event|
      Severity: Major
      Found in lib/glimmer/swt/widget_proxy.rb - About 1 day to fix

        Method property_type_converters has 137 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def property_type_converters
                color_converter = lambda do |value|
                  if value.is_a?(Symbol) || value.is_a?(String)
                    ColorProxy.new(value).swt_color
                  elsif value.is_a?(RGB)
        Severity: Major
        Found in lib/glimmer/swt/widget_proxy.rb - About 5 hrs to fix

          Method widget_custom_attribute_mapping has 92 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def widget_custom_attribute_mapping
                  # TODO scope per widget class type just like other mappings
                  @swt_widget_custom_attribute_mapping ||= {
                    'drag_source' => {
                      getter: {name: 'getShell', invoker: lambda { |widget, args|
          Severity: Major
          Found in lib/glimmer/swt/widget_proxy.rb - About 3 hrs to fix

            Method print has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

                  def print(gc=nil, job_name: nil)
                    if gc.is_a?(org.eclipse.swt.graphics.GC)
                      @swt_widget.print(gc)
                    else
                      image = Image.new(DisplayProxy.instance.swt_display, bounds)
            Severity: Minor
            Found in lib/glimmer/swt/widget_proxy.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

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

                  def initialize(*init_args, swt_widget: nil)
                    auto_exec do
                      @image_double_buffered = !!(init_args&.last&.include?(:image_double_buffered) && init_args&.last&.delete(:image_double_buffered))
                      if swt_widget.nil?
                        underscored_widget_name, parent, args = init_args
            Severity: Minor
            Found in lib/glimmer/swt/widget_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 find_listener has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                  def self.find_listener(swt_widget_class, underscored_listener_name)
                    @listeners ||= {}
                    listener_key = [swt_widget_class.name, underscored_listener_name]
                    unless @listeners.has_key?(listener_key)
                      listener_method_name = underscored_listener_name.camelcase(:lower)
            Severity: Minor
            Found in lib/glimmer/swt/widget_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 swt_widget_class_for has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                  def self.swt_widget_class_for(underscored_widget_name)
                    # TODO clear memoization for a keyword if a custom widget was defined with that keyword
                    unless flyweight_swt_widget_classes.keys.include?(underscored_widget_name)
                      begin
                        underscored_widget_name = KEYWORD_ALIASES[underscored_widget_name] if KEYWORD_ALIASES[underscored_widget_name]
            Severity: Minor
            Found in lib/glimmer/swt/widget_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 print has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def print(gc=nil, job_name: nil)
                    if gc.is_a?(org.eclipse.swt.graphics.GC)
                      @swt_widget.print(gc)
                    else
                      image = Image.new(DisplayProxy.instance.swt_display, bounds)
            Severity: Minor
            Found in lib/glimmer/swt/widget_proxy.rb - About 1 hr to fix

              Method initialize has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def initialize(*init_args, swt_widget: nil)
                      auto_exec do
                        @image_double_buffered = !!(init_args&.last&.include?(:image_double_buffered) && init_args&.last&.delete(:image_double_buffered))
                        if swt_widget.nil?
                          underscored_widget_name, parent, args = init_args
              Severity: Minor
              Found in lib/glimmer/swt/widget_proxy.rb - About 1 hr to fix

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

                      def can_handle_drag_observation_request?(observation_request)
                        auto_exec do
                          return false unless swt_widget.is_a?(Control)
                          potential_drag_source = @drag_source_proxy.nil?
                          ensure_drag_source_proxy
                Severity: Minor
                Found in lib/glimmer/swt/widget_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 get_attribute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                      def get_attribute(attribute_name)
                        widget_custom_attribute = widget_custom_attribute_mapping[attribute_name.to_s]
                        swt_widget_operation = false
                        result = nil
                        auto_exec do
                Severity: Minor
                Found in lib/glimmer/swt/widget_proxy.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

                Avoid deeply nested control flow statements.
                Open

                                if printer.start_page
                                  printer_gc.drawImage(image, 0, 0)
                                  printer.end_page
                                else
                                  success = false
                Severity: Major
                Found in lib/glimmer/swt/widget_proxy.rb - About 45 mins to fix

                  Method can_handle_drop_observation_request? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def can_handle_drop_observation_request?(observation_request)
                          auto_exec do
                            return false unless swt_widget.is_a?(Control)
                            potential_drop_target = @drop_target_proxy.nil?
                            ensure_drop_target_proxy
                  Severity: Minor
                  Found in lib/glimmer/swt/widget_proxy.rb - About 35 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 handle_observation_request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def handle_observation_request(observation_request, &block)
                          observation_request = normalize_observation_request(observation_request)
                          if observation_request.start_with?('on_drag_enter')
                            original_block = block
                            block = Proc.new do |event|
                  Severity: Minor
                  Found in lib/glimmer/swt/widget_proxy.rb - About 35 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 add_listener has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def add_listener(underscored_listener_name, &block)
                          auto_exec do
                            widget_add_listener_method, listener_class, listener_method = self.class.find_listener(@swt_widget.getClass, underscored_listener_name)
                            widget_listener_proxy = nil
                            safe_block = lambda do |*args|
                  Severity: Minor
                  Found in lib/glimmer/swt/widget_proxy.rb - About 35 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 extract_args has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def extract_args(underscored_widget_name, args)
                          @arg_extractor_mapping ||= {
                            'menu_item' => lambda do |args|
                              index = args.delete(args.last) if args.last.is_a?(Numeric)
                              extra_options = [index].compact
                  Severity: Minor
                  Found in lib/glimmer/swt/widget_proxy.rb - About 35 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 create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def create(*init_args, swt_widget: nil)
                            DisplayProxy.instance.auto_exec do
                              return swt_widget.get_data('proxy') if swt_widget&.get_data('proxy')
                              keyword, parent, args = init_args
                              selected_widget_proxy_class = widget_proxy_class(keyword || underscored_widget_name(swt_widget))
                  Severity: Minor
                  Found in lib/glimmer/swt/widget_proxy.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 property_type_converters has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def property_type_converters
                          color_converter = lambda do |value|
                            if value.is_a?(Symbol) || value.is_a?(String)
                              ColorProxy.new(value).swt_color
                            elsif value.is_a?(RGB)
                  Severity: Minor
                  Found in lib/glimmer/swt/widget_proxy.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

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

                              :selection_count => lambda do |observer|
                                on_widget_selected { |event|
                                  observer.call(@swt_widget.getSelectionCount) unless @swt_widget.getCaretOffset == 0 && @last_modify_text != text
                                }
                                on_swt_keyup { |event|
                  Severity: Major
                  Found in lib/glimmer/swt/widget_proxy.rb and 2 other locations - About 1 hr to fix
                  lib/glimmer/swt/widget_proxy.rb on lines 469..478
                  lib/glimmer/swt/widget_proxy.rb on lines 491..500

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

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

                              :selection => lambda do |observer|
                                on_widget_selected { |event|
                                  observer.call(@swt_widget.getSelection) unless @swt_widget.getCaretOffset == 0 && @last_modify_text != text
                                }
                                on_swt_keyup { |event|
                  Severity: Major
                  Found in lib/glimmer/swt/widget_proxy.rb and 2 other locations - About 1 hr to fix
                  lib/glimmer/swt/widget_proxy.rb on lines 480..489
                  lib/glimmer/swt/widget_proxy.rb on lines 491..500

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

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

                              :selection_range => lambda do |observer|
                                on_widget_selected { |event|
                                  observer.call(@swt_widget.getSelectionRange) unless @swt_widget.getCaretOffset == 0 && @last_modify_text != text
                                }
                                on_swt_keyup { |event|
                  Severity: Major
                  Found in lib/glimmer/swt/widget_proxy.rb and 2 other locations - About 1 hr to fix
                  lib/glimmer/swt/widget_proxy.rb on lines 469..478
                  lib/glimmer/swt/widget_proxy.rb on lines 480..489

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

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

                              :caret_position => lambda do |observer|
                                on_swt_keydown { |event|
                                  observer.call(@swt_widget.getCaretPosition)
                                }
                                on_swt_keyup { |event|
                  Severity: Minor
                  Found in lib/glimmer/swt/widget_proxy.rb and 2 other locations - About 30 mins to fix
                  lib/glimmer/swt/widget_proxy.rb on lines 409..420
                  lib/glimmer/swt/widget_proxy.rb on lines 423..434

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

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

                              :selection_count => lambda do |observer|
                                on_swt_keydown { |event|
                                  observer.call(@swt_widget.getSelectionCount)
                                }
                                on_swt_keyup { |event|
                  Severity: Minor
                  Found in lib/glimmer/swt/widget_proxy.rb and 2 other locations - About 30 mins to fix
                  lib/glimmer/swt/widget_proxy.rb on lines 395..406
                  lib/glimmer/swt/widget_proxy.rb on lines 409..420

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

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

                              :selection => lambda do |observer|
                                on_swt_keydown { |event|
                                  observer.call(@swt_widget.getSelection)
                                }
                                on_swt_keyup { |event|
                  Severity: Minor
                  Found in lib/glimmer/swt/widget_proxy.rb and 2 other locations - About 30 mins to fix
                  lib/glimmer/swt/widget_proxy.rb on lines 395..406
                  lib/glimmer/swt/widget_proxy.rb on lines 423..434

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

                  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

                          auto_exec do
                            return false unless swt_widget.is_a?(Control)
                            potential_drag_source = @drag_source_proxy.nil?
                            ensure_drag_source_proxy
                            @drag_source_proxy.can_handle_observation_request?(observation_request).tap do |result|
                  Severity: Minor
                  Found in lib/glimmer/swt/widget_proxy.rb and 1 other location - About 25 mins to fix
                  lib/glimmer/swt/widget_proxy.rb on lines 739..747

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

                  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

                          auto_exec do
                            return false unless swt_widget.is_a?(Control)
                            potential_drop_target = @drop_target_proxy.nil?
                            ensure_drop_target_proxy
                            @drop_target_proxy.can_handle_observation_request?(observation_request).tap do |result|
                  Severity: Minor
                  Found in lib/glimmer/swt/widget_proxy.rb and 1 other location - About 25 mins to fix
                  lib/glimmer/swt/widget_proxy.rb on lines 722..730

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

                  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

                  There are no issues that match your filters.

                  Category
                  Status