fluent/fluentd

View on GitHub

Showing 577 of 664 total issues

Method initialize has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def initialize(type, format = nil, localtime = nil, timezone = nil, utc = nil, force_localtime = nil, fallbacks = [])
Severity: Major
Found in lib/fluent/time.rb - About 50 mins to fix

    Method server_create_for_tls_connection has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def server_create_for_tls_connection(shared, bind, port, conf, backlog, socket_option_setter, &block)
    Severity: Major
    Found in lib/fluent/plugin_helper/server.rb - About 50 mins to fix

      Method initialize has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

                def initialize(sock, max_bytes, flags, close_socket, log, under_plugin_development, &callback)
      Severity: Major
      Found in lib/fluent/plugin_helper/server.rb - About 50 mins to fix

        Method initialize has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                  def initialize(sock, context, socket_option_setter, close_callback, log, under_plugin_development, connect_callback)
        Severity: Major
        Found in lib/fluent/plugin_helper/server.rb - About 50 mins to fix

          Method initialize has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  def initialize(title, interval, repeat, log, checker, detacher, &callback)
          Severity: Major
          Found in lib/fluent/plugin_helper/timer.rb - About 50 mins to fix

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

                def read_messages(conn, &block)
                  feeder = nil
                  serializer = nil
                  bytes = 0
                  conn.data do |data|
            Severity: Minor
            Found in lib/fluent/plugin/in_forward.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

                          raise Fluent::ConfigError, "insufficient timestamp placeholders in path" if time_placeholders.scan(/../).any?{|ph| !original.include?(ph) }
            Severity: Major
            Found in lib/fluent/plugin/out_file.rb - About 45 mins to fix

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

                  def receive_lines(lines, tail_watcher)
                    es = @receive_handler.call(lines, tail_watcher)
                    unless es.empty?
                      tag = if @tag_prefix || @tag_suffix
                              @tag_prefix + tail_watcher.tag + @tag_suffix
              Severity: Minor
              Found in lib/fluent/plugin/in_tail.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

                            pos = @read_from_head ? 0 : fsize
              Severity: Major
              Found in lib/fluent/plugin/in_tail.rb - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                  if adding_bytes > @chunk_limit_size
                                    errors << "concatenated/appended a #{adding_bytes} bytes record (nth: #{writing_splits_index}) is larger than buffer chunk limit size (#{@chunk_limit_size})"
                                    writing_splits_index += 1
                                    next
                                  else
                Severity: Major
                Found in lib/fluent/plugin/buffer.rb - About 45 mins to fix

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

                      def detach_watcher_after_rotate_wait(tw, ino)
                        # Call event_loop_attach/event_loop_detach is high-cost for short-live object.
                        # If this has a problem with large number of files, use @_event_loop directly instead of timer_execute.
                        if @open_on_every_update
                          # Detach now because it's already closed, waiting it doesn't make sense.
                  Severity: Minor
                  Found in lib/fluent/plugin/in_tail.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

                                  break if merged_col.end_with?(@quote_char)
                  Severity: Major
                  Found in lib/fluent/plugin/parser_csv.rb - About 45 mins to fix

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

                          def check_pong(ri, message)
                            @log.debug('checking pong')
                            # ['PONG', bool(authentication result), 'reason if authentication failed',
                            #  self_hostname, sha512\_hex(salt + self_hostname + nonce + sharedkey)]
                            unless message.size == 5 && message[0] == 'PONG'
                    Severity: Minor
                    Found in lib/fluent/plugin/out_forward/handshake_protocol.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

                                        @ignore_list << p if @ignore_repeated_permission_error
                    Severity: Major
                    Found in lib/fluent/plugin/in_tail.rb - About 45 mins to fix

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

                          def configure(conf)
                            super
                      
                            unless @as_secondary
                              raise Fluent::ConfigError, "This plugin can only be used in the <secondary> section"
                      Severity: Minor
                      Found in lib/fluent/plugin/out_secondary_file.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 start has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def start
                            super
                      
                            if @pos_file
                              pos_file_dir = File.dirname(@pos_file)
                      Severity: Minor
                      Found in lib/fluent/plugin/in_tail.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 handle_parsed has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def handle_parsed(tag, record, t, values)
                            if values && @inject_key_prefix
                              values = Hash[values.map { |k, v| [@inject_key_prefix + k, v] }]
                            end
                            r = @hash_value_field ? {@hash_value_field => values} : values
                      Severity: Minor
                      Found in lib/fluent/plugin/filter_parser.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 tick has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def tick
                              now = Time.now.to_f
                              unless available?
                                if @failure.hard_timeout?(now)
                                  @failure.clear
                      Severity: Minor
                      Found in lib/fluent/plugin/out_forward.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 enqueued! has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                              def enqueued!
                                return unless self.staged?
                      
                                new_chunk_path = self.class.generate_queued_chunk_path(@path, @unique_id)
                      
                      
                      Severity: Minor
                      Found in lib/fluent/plugin/buffer/file_single_chunk.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 ack_check has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def ack_check(select_interval)
                            @ack_handler.collect_response(select_interval) do |chunk_id, node, sock, result|
                              @connection_manager.close(sock)
                      
                              case result
                      Severity: Minor
                      Found in lib/fluent/plugin/out_forward.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

                      Severity
                      Category
                      Status
                      Source
                      Language