fluent/fluentd

View on GitHub

Showing 664 of 664 total issues

Method parse_element has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def parse_element(root_element, elem_name, attrs = {}, elems = [])
while true
spacing
if eof?
if root_element
Severity: Major
Found in lib/fluent/config/v1_parser.rb - About 2 hrs to fix

    Method configure has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def configure(conf)
    @variable_store = Fluent::VariableStore.fetch_or_build(:in_tail)
    compat_parameters_convert(conf, :parser)
    parser_config = conf.elements('parse').first
    unless parser_config
    Severity: Major
    Found in lib/fluent/plugin/in_tail.rb - About 2 hrs to fix

      Method get_monitor_info has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      def get_monitor_info(pe, opts={})
      obj = {}
       
      # Common plugin information
      obj['plugin_id'] = pe.plugin_id
      Severity: Minor
      Found in lib/fluent/plugin/in_monitor_agent.rb - About 2 hrs to fix

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

      def configure(conf)
      super
       
      @connection_cache = Array.new(actual_flush_thread_count, ConnectionCache.new("", nil)) if @reuse_connections
       
       
      Severity: Minor
      Found in lib/fluent/plugin/out_http.rb - About 2 hrs to fix

      Method parse_multilines has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      def parse_multilines(lines, tail_watcher)
      lb = tail_watcher.line_buffer_timer_flusher.line_buffer
      es = Fluent::MultiEventStream.new
      if @parser.has_firstline?
      tail_watcher.line_buffer_timer_flusher.reset_timer
      Severity: Minor
      Found in lib/fluent/plugin/in_tail.rb - About 2 hrs to fix

      Method configure has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def configure(conf)
      compat_parameters_convert(conf, :formatter, :buffer, :inject, default_chunk_key: "time")
       
      configured_time_slice_format = conf['time_slice_format']
       
       
      Severity: Major
      Found in lib/fluent/plugin/out_file.rb - About 2 hrs to fix

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

        def generate_path_template(original, timekey, append, compress, path_suffix: '', time_slice_format: nil)
        comp_suffix = compression_suffix(compress)
        index_placeholder = append ? '' : '_**'
        if original.index('*')
        raise "BUG: configuration error must be raised for path including '*' without timekey" unless timekey
        Severity: Minor
        Found in lib/fluent/plugin/out_file.rb - About 2 hrs to fix

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

        def resume
        stage = {}
        queue = []
        exist_broken_file = false
         
         
        Severity: Minor
        Found in lib/fluent/plugin/buf_file_single.rb - About 2 hrs to fix

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

        def flush_thread_run(state)
        flush_thread_interval = @buffer_config.flush_thread_interval
         
        state.next_clock = Fluent::Clock.now + flush_thread_interval
         
         
        Severity: Minor
        Found in lib/fluent/plugin/output.rb - About 2 hrs to fix

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

        def configure(conf)
        bufconf = CompatOutputUtils.buffer_section(conf)
        config_style = (bufconf ? :v1 : :v0)
        if config_style == :v0
        buf_params = {
        Severity: Minor
        Found in lib/fluent/compat/output.rb - About 2 hrs to fix

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

        def storage_create(usage: '', type: nil, conf: nil, default_type: nil)
        if conf && conf.respond_to?(:arg) && !conf.arg.empty?
        usage = conf.arg
        end
        if !usage.empty? && usage !~ /^[a-zA-Z][-_.a-zA-Z0-9]*$/
        Severity: Minor
        Found in lib/fluent/plugin_helper/storage.rb - About 2 hrs to fix

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

        def compat_parameters_buffer(conf, default_chunk_key: '')
        # return immediately if <buffer> section exists, or any buffer-related parameters don't exist
        return unless conf.elements('buffer').empty?
        return if (BUFFER_PARAMS.keys + BUFFER_TIME_SLICED_PARAMS.keys).all?{|k| !conf.has_key?(k) }
         
         
        Severity: Minor
        Found in lib/fluent/plugin_helper/compat_parameters.rb - About 2 hrs to fix

        Method run_rpc_server has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def run_rpc_server
        @rpc_server = RPC::Server.new(@rpc_endpoint, $log)
         
        # built-in RPC for signals
        @rpc_server.mount_proc('/api/processes.interruptWorkers') { |req, res|
        Severity: Major
        Found in lib/fluent/supervisor.rb - About 2 hrs to fix

          File cat.rb has 278 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'optparse'
          require 'fluent/env'
          require 'fluent/time'
          require 'fluent/msgpack_factory'
          require 'fluent/version'
          Severity: Minor
          Found in lib/fluent/command/cat.rb - About 2 hrs to fix

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

            class ForwardOutput < Output
            Fluent::Plugin.register_output('forward', self)
             
            helpers :socket, :server, :timer, :thread, :compat_parameters, :service_discovery
             
             
            Severity: Minor
            Found in lib/fluent/plugin/out_forward.rb - About 2 hrs to fix

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

              class FileSingleChunk < Chunk
              class FileChunkError < StandardError; end
               
              ## buffer path user specified : /path/to/directory
              ## buffer chunk path : /path/to/directory/fsb.key.b513b61c9791029c2513b61c9791029c2.buf
              Severity: Minor
              Found in lib/fluent/plugin/buffer/file_single_chunk.rb - About 2 hrs to fix

                Method setup_global_logger has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                def setup_global_logger(supervisor: false)
                if supervisor
                worker_id = 0
                process_type = :supervisor
                else
                Severity: Major
                Found in lib/fluent/supervisor.rb - About 2 hrs to fix

                  File storage.rb has 276 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require 'forwardable'
                   
                  require 'fluent/plugin'
                  require 'fluent/plugin/storage'
                  require 'fluent/plugin_helper/timer'
                  Severity: Minor
                  Found in lib/fluent/plugin_helper/storage.rb - About 2 hrs to fix

                    Method call has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def call
                    parse_options!
                    FileUtils.mkdir_p(gem_name)
                    Dir.chdir(gem_name) do
                    copy_license
                    Severity: Minor
                    Found in lib/fluent/command/plugin_generator.rb - About 2 hrs to fix

                    Method convert_line_to_event has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def convert_line_to_event(line, es, tail_watcher)
                    begin
                    line.chomp! # remove \n
                    @parser.parse(line) { |time, record|
                    if time && record
                    Severity: Minor
                    Found in lib/fluent/plugin/in_tail.rb - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language