fluent/fluentd

View on GitHub

Showing 577 of 664 total issues

Method parse_bracket_notation has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def self.parse_bracket_notation(param)
          orig_param = param
          result = []
          param = param[1..-1]
          in_bracket = false
Severity: Minor
Found in lib/fluent/plugin_helper/record_accessor.rb - About 1 hr to fix

    Method build_type_converters has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def build_type_converters(types)
            return nil unless types
    
            converters = {}
    
    
    Severity: Minor
    Found in lib/fluent/plugin/parser.rb - About 1 hr to fix

      Method setup_http_option has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def setup_http_option
            use_ssl = @endpoint.start_with?('https')
            opt = {
              open_timeout: @open_timeout,
              read_timeout: @read_timeout,
      Severity: Minor
      Found in lib/fluent/plugin/out_http.rb - About 1 hr to fix

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

            def configure(conf)
              exec_filter_compat_parameters_convert!(conf)
              compat_parameters_convert(conf, :buffer)
        
              if inject_section = conf.elements('inject').first
        Severity: Minor
        Found in lib/fluent/plugin/out_exec_filter.rb - About 1 hr to fix

          Method write_guard has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def write_guard(&block)
                  begin
                    block.call
                  rescue Fluent::Plugin::Buffer::BufferOverflowError
                    log.warn "failed to write data into buffer by buffer overflow", action: @buffer_config.overflow_action
          Severity: Minor
          Found in lib/fluent/plugin/output.rb - About 1 hr to fix

            Method socket_option_set has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def socket_option_set(sock, resolve_name: nil, nonblock: false, linger_timeout: nil, recv_timeout: nil, send_timeout: nil, receive_buffer_size: nil, send_keepalive_packet: nil)
                    unless resolve_name.nil?
                      sock.do_not_reverse_lookup = !resolve_name
                    end
                    if nonblock
            Severity: Minor
            Found in lib/fluent/plugin_helper/socket_option.rb - About 1 hr to fix

              Method lifecycle has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def lifecycle(desc: false, kind_callback: nil, kind_or_agent_list: nil)
                    only_zero_downtime_restart_ready = false
              
                    unless kind_or_agent_list
                      if @source_only_mode.enabled?
              Severity: Minor
              Found in lib/fluent/root_agent.rb - About 1 hr to fix

                Method build_object has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                      def build_object(opts)
                        qs = opts[:query]
                        if tag = qs['tag'.freeze].first
                          # ?tag= to search an output plugin by match pattern
                          if obj = @agent.plugin_info_by_tag(tag, opts)
                Severity: Minor
                Found in lib/fluent/plugin/in_monitor_agent.rb - About 1 hr 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 convert_values has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                      def convert_values(time, record)
                        return time, record unless @execute_convert_values
                
                        record.each_key do |key|
                          value = record[key]
                Severity: Minor
                Found in lib/fluent/plugin/parser.rb - About 1 hr 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 configure has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    def configure(conf)
                      compat_parameters_convert(conf, :parser)
                
                      super
                
                
                Severity: Minor
                Found in lib/fluent/plugin/in_syslog.rb - About 1 hr 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 with_io has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                        def with_io
                          if @open_on_every_update
                            io = open
                            begin
                              yield io
                Severity: Minor
                Found in lib/fluent/plugin/in_tail.rb - About 1 hr 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 on_timer has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    def on_timer
                      now = Fluent::EventTime.now
                
                      array = []
                      map = {}
                Severity: Minor
                Found in lib/fluent/plugin/in_object_space.rb - About 1 hr 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 try_rollback_all has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                      def try_rollback_all
                        return unless @dequeued_chunks
                        @dequeued_chunks_mutex.synchronize do
                          until @dequeued_chunks.empty?
                            info = @dequeued_chunks.shift
                Severity: Minor
                Found in lib/fluent/plugin/output.rb - About 1 hr 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 run_rpc_server has a Cognitive Complexity of 12 (exceeds 5 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: Minor
                Found in lib/fluent/supervisor.rb - About 1 hr 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 on_record has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    def on_record(time, record)
                      tag = extract_tag_from_record(record)
                      tag = @added_prefix_string + tag if tag && @add_prefix
                      tag ||= @tag
                      time ||= extract_time_from_record(record) || Fluent::EventTime.now
                Severity: Minor
                Found in lib/fluent/plugin/out_exec_filter.rb - About 1 hr 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 parser_create has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                      def parser_create(usage: '', type: nil, conf: nil, default_type: nil)
                        parser = @_parsers[usage]
                        return parser if parser && !type && !conf
                
                        type = if type
                Severity: Minor
                Found in lib/fluent/plugin_helper/parser.rb - About 1 hr 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 formatter_create has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                      def formatter_create(usage: '', type: nil, conf: nil, default_type: nil)
                        formatter = @_formatters[usage]
                        return formatter if formatter && !type && !conf
                
                        type = if type
                Severity: Minor
                Found in lib/fluent/plugin_helper/formatter.rb - About 1 hr 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 parse_multilines has 35 lines of code (exceeds 25 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 1 hr to fix

                  Method create_transfer_socket has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def create_transfer_socket(host, port, hostname, &block)
                        case @transport
                        when :tls
                          socket_create_tls(
                            host, port,
                  Severity: Minor
                  Found in lib/fluent/plugin/out_forward.rb - About 1 hr to fix

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

                        def configure(conf)
                          compat_parameters_convert(conf, :parser)
                          parser_config = conf.elements('parse').first
                          unless parser_config
                            raise Fluent::ConfigError, "<parse> section is required."
                    Severity: Minor
                    Found in lib/fluent/plugin/in_tcp.rb - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language