adHawk/hanami-events-cloud_pubsub

View on GitHub

Showing 44 of 45 total issues

Method register_listener has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def register_listener(event_name, topic, subscriber_id, auto_ack, subscriber_opts, sub)
Severity: Minor
Found in lib/hanami/events/adapter/cloud_pubsub.rb - About 45 mins to fix

    Line is too long. [82/80]
    Open

            # Called on TTIN to inspect the state of the runner in a terminal friendly

    Line is too long. [89/80]
    Open

                raise InvalidMiddlewareError, middleware unless middleware.respond_to?(:call)

    Do not suppress exceptions.
    Open

              rescue StandardError

    This cop checks for rescue blocks with no body.

    Example:

    # bad
    
    def some_method
      do_something
    rescue
      # do nothing
    end

    Example:

    # bad
    
    begin
      do_something
    rescue
      # do nothing
    end

    Example:

    # good
    
    def some_method
      do_something
    rescue
      handle_exception
    end

    Example:

    # good
    
    begin
      do_something
    rescue
      handle_exception
    end

    Line is too long. [84/80]
    Open

                                               tags: %i[event_name subscription status],

    Line is too long. [94/80]
    Open

              logger.debug("Registered listener for #{subscriber_id} with: #{subscriber_options}")

    Line is too long. [81/80]
    Open

                30, 60, 120, 300, 1800, 3600, 21_600 # Tasks may be very long-running

    Line is too long. [95/80]
    Open

            def register_listener(event_name, topic, subscriber_id, auto_ack, subscriber_opts, sub)

    Line is too long. [100/80]
    Open

                histogram :subscriber_runtime, comment: 'A histogram of the subscriber execution time.',

    Line is too long. [93/80]
    Open

                    "but its name #{found_subscription.topic.name} does not match #{@event_name}"

    Line is too long. [94/80]
    Open

                builder.use Yabeda::Prometheus::Exporter if defined?(Yabeda::Prometheus::Exporter)

    Line is too long. [81/80]
    Open

            # Instead of making `start` blocking, expose a way to probe for readiness

    Line is too long. [94/80]
    Open

              sub = Hanami::Events::CloudPubsub::Subscriber.new(event_name, block, logger: logger)

    Line is too long. [81/80]
    Open

            # This pattern is similar to Kubernete's healthiness and readniess probes

    Line is too long. [92/80]
    Open

                requirements_for_all = ::Hanami::Components.component('all').send(:requirements)

    Line is too long. [88/80]
    Open

                  file = parts[:file].sub(/^#{Regexp.escape(File.join(Dir.getwd, ''))}/, '')

    Line is too long. [81/80]
    Open

                  ENV['PUBSUB_EMULATOR_HOST'] ||= 'localhost:8085' if opts[:emulator]

    Do not suppress exceptions.
    Open

          rescue LoadError
    Severity: Minor
    Found in lib/hanami/events/cloud_pubsub.rb by rubocop

    This cop checks for rescue blocks with no body.

    Example:

    # bad
    
    def some_method
      do_something
    rescue
      # do nothing
    end

    Example:

    # bad
    
    begin
      do_something
    rescue
      # do nothing
    end

    Example:

    # good
    
    def some_method
      do_something
    rescue
      handle_exception
    end

    Example:

    # good
    
    begin
      do_something
    rescue
      handle_exception
    end

    Line is too long. [95/80]
    Open

              sub.retry_policy = retry_policy if sub.retry_policy&.to_grpc != retry_policy&.to_grpc

    Line is too long. [82/80]
    Open

            # If a gracefully_shutdown times out or fails, this method will be called.
    Severity
    Category
    Status
    Source
    Language