Showing 13 of 15 total issues

Class ArgumentBuilder has 37 methods (exceeds 20 allowed). Consider refactoring.
Open

    class ArgumentBuilder < BaseArgumentBuilder
      def method_argument_name
        name if has_input_value? && !helper_argument?
      end

Severity: Minor
Found in lib/gir_ffi/builders/argument_builder.rb - About 4 hrs to fix

    Class UserDefinedBuilder has 28 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class UserDefinedBuilder < ObjectBuilder
          def initialize(info)
            @info = info
          end
    
    
    Severity: Minor
    Found in lib/gir_ffi/builders/user_defined_builder.rb - About 3 hrs to fix

      Class Value has 28 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class Value
          setup_instance_method! :init
      
          METHOD_MAP = {
            TYPE_INVALID => [:get_none, :set_none],
      Severity: Minor
      Found in lib/ffi-gobject/value.rb - About 3 hrs to fix

        Class IObjectInfo has 24 methods (exceeds 20 allowed). Consider refactoring.
        Open

          class IObjectInfo < IRegisteredTypeInfo
            def type_name
              Lib.g_object_info_get_type_name self
            end
        
        
        Severity: Minor
        Found in lib/ffi-gobject_introspection/i_object_info.rb - About 2 hrs to fix

          Class CallbackArgumentBuilder has 23 methods (exceeds 20 allowed). Consider refactoring.
          Open

              class CallbackArgumentBuilder < BaseArgumentBuilder
                def method_argument_name
                  @method_argument_name ||= name || new_variable
                end
          
          
          Severity: Minor
          Found in lib/gir_ffi/builders/callback_argument_builder.rb - About 2 hrs to fix

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

                class ObjectBuilder < RegisteredTypeBuilder
                  include WithLayout
            
                  # Dummy builder for the ObjectBase class
                  class ObjectBaseBuilder
            Severity: Minor
            Found in lib/gir_ffi/builders/object_builder.rb - About 2 hrs to fix

              Method modul has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                    def modul
                      unless defined? @module
                        build_dependencies
                        instantiate_module
                        setup_lib_for_ffi unless lib_already_set_up
              Severity: Minor
              Found in lib/gir_ffi/builders/module_builder.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

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

                def self.signal_connect(object, detailed_signal, data = nil, after = false, &block)
              Severity: Minor
              Found in lib/ffi-gobject.rb - About 35 mins to fix

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

                    def self.marshaller(closure, return_value, param_values, _invocation_hint,
                                        _marshal_data)
                Severity: Minor
                Found in lib/ffi-gobject/ruby_closure.rb - About 35 mins to fix

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

                        def set_up_destroy_notifier_relations
                          @base_argument_builders.each do |bldr|
                            if (idx = bldr.destroy_idx) >= 0
                              target = @base_argument_builders[idx]
                              if target.specialized_type_tag == :callback &&
                  Severity: Minor
                  Found in lib/gir_ffi/builders/argument_builder_collection.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 conversion has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def conversion
                          case @type_info.flattened_tag
                          when :utf8, :filename
                            if @ownership_transfer == :everything
                              "GirFFI::AllocationHelper.free_after #{@argument}, &:to_utf8"
                  Severity: Minor
                  Found in lib/gir_ffi/builders/c_to_ruby_convertor.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 set_up_user_data_relations has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def set_up_user_data_relations
                          @base_argument_builders.each do |bldr|
                            if (idx = bldr.closure_idx) >= 0
                              target_bldr = @base_argument_builders[idx]
                              unless target_bldr.specialized_type_tag == :void
                  Severity: Minor
                  Found in lib/gir_ffi/builders/argument_builder_collection.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 create_for has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def self.create_for path
                      stage = PhotoWall.new
                  
                      stage.instance_eval do
                        @path = path
                  Severity: Minor
                  Found in examples/clutter.rb - About 25 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Severity
                  Category
                  Status
                  Source
                  Language