thomis/eventhub-processor2

View on GitHub

Showing 296 of 296 total issues

Module has too many lines. [132/100]
Open

  module Configuration
    # it's a singleton (don't allow to instantiate this class)
    extend self
    extend Helper

Severity: Minor
Found in lib/eventhub/configuration.rb by rubocop

This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [117/100]
Open

  class Message
    include Helper

    VERSION = "1.0.0".freeze

Severity: Minor
Found in lib/eventhub/message.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [26/10]
Open

    def default_configuration
      {
        server: {
          user: "guest",
          password: "guest",
Severity: Minor
Found in lib/eventhub/configuration.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [25/10]
Open

    def main_event_loop
      Celluloid.boot
      setup_signal_handler
      start_supervisor

Severity: Minor
Found in lib/eventhub/processor2.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [24/10]
Open

    def parse_options(argv = ARGV)
      @config_file = File.join(Dir.getwd, "config", "#{@name}.json")

      OptionParser.new { |opts|
        note = "Define environment"
Severity: Minor
Found in lib/eventhub/configuration.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [20/10]
Open

    def create_bunny_connection
      server = EventHub::Configuration.server

      protocol = "amqp"
      connection_properties = {}
Severity: Minor
Found in lib/eventhub/helper.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for main_event_loop is too high. [23.37/15]
Open

    def main_event_loop
      Celluloid.boot
      setup_signal_handler
      start_supervisor

Severity: Minor
Found in lib/eventhub/processor2.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for create_bunny_connection is too high. [21.31/15]
Open

    def create_bunny_connection
      server = EventHub::Configuration.server

      protocol = "amqp"
      connection_properties = {}
Severity: Minor
Found in lib/eventhub/helper.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method has too many lines. [16/10]
Open

    def self.from_json(raw)
      data = JSON.parse(raw)
      Message.new(data.get("header"), data.get("body"), raw)
    rescue => e
      Message.new(
Severity: Minor
Found in lib/eventhub/message.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [16/10]
Open

    def initialize(header = nil, body = nil, raw = nil)
      @header = header || {}
      @body = body || {}
      @raw = raw

Severity: Minor
Found in lib/eventhub/message.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [12/10]
Open

    def load!(args = {})
      # for better rspec testing
      @config_file = args[:config_file] if args[:config_file]
      @environment = args[:environment] if args[:environment]

Severity: Minor
Found in lib/eventhub/configuration.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [12/10]
Open

    def load_more!(args = {})
      return unless args[:pattern]

      Dir.glob(args[:pattern]).sort.each do |name|
        next if File.directory?(name)
Severity: Minor
Found in lib/eventhub/configuration.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for initialize is too high. [17.38/15]
Open

    def initialize(header = nil, body = nil, raw = nil)
      @header = header || {}
      @body = body || {}
      @raw = raw

Severity: Minor
Found in lib/eventhub/message.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method has too many lines. [12/10]
Open

    def start_supervisor
      @config = Celluloid::Supervision::Configuration.define([
        {type: ActorHeartbeat, as: :actor_heartbeat, args: [self]},
        {type: ActorListenerAmqp, as: :actor_listener_amqp, args: [self]},
        {type: ActorListenerHttp, as: :actor_listener_http, args: []}
Severity: Minor
Found in lib/eventhub/processor2.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for load! is too high. [16.43/15]
Open

    def load!(args = {})
      # for better rspec testing
      @config_file = args[:config_file] if args[:config_file]
      @environment = args[:environment] if args[:environment]

Severity: Minor
Found in lib/eventhub/configuration.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method has too many lines. [11/10]
Open

  def self.logger
    unless defined?(@logger)
      @logger = ::EventHub::Components::MultiLogger.new
      @logger.add_device(Logger.new($stdout))

Severity: Minor
Found in lib/eventhub/logger.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Complex method EventHub::ActorListenerAmqp#listen (36.1)
Open

    def listen(args = {})
      with_listen(args) do |connection, channel, consumer, queue, queue_name|
        EventHub.logger.info("Listening to queue [#{queue_name}]")
        consumer.on_delivery do |delivery_info, metadata, payload|
          EventHub.logger.info("#{queue_name}: [#{delivery_info.delivery_tag}]" \
Severity: Minor
Found in lib/eventhub/actor_listener_amqp.rb by flog

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Assignment Branch Condition size for parse_options is too high. [15.03/15]
Open

    def parse_options(argv = ARGV)
      @config_file = File.join(Dir.getwd, "config", "#{@name}.json")

      OptionParser.new { |opts|
        note = "Define environment"
Severity: Minor
Found in lib/eventhub/configuration.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for load_more! is too high. [15.59/15]
Open

    def load_more!(args = {})
      return unless args[:pattern]

      Dir.glob(args[:pattern]).sort.each do |name|
        next if File.directory?(name)
Severity: Minor
Found in lib/eventhub/configuration.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for success is too high. [15.23/15]
Open

  def success(process_time, size)
    @mutex.lock
    @messages_total_process_time += process_time
    @messages_average_process_time = (messages_total_process_time + process_time) / (messages_successful + 1).to_f
    @messages_average_size = (messages_total_size + size) / (messages_successful + 1).to_f
Severity: Minor
Found in lib/eventhub/statistics.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Severity
Category
Status
Source
Language