fluent/fluentd

View on GitHub

Showing 577 of 664 total issues

Method cert_option_create_context has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def cert_option_create_context(version, insecure, ciphers, conf)
        cert, key, extra = cert_option_server_validate!(conf)

        ctx = OpenSSL::SSL::SSLContext.new
        # inject OpenSSL::SSL::SSLContext::DEFAULT_PARAMS
Severity: Minor
Found in lib/fluent/plugin_helper/cert_option.rb - About 1 hr to fix

    Method try_write has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def try_write(chunk)
          tmpfile = nil
          prog = if chunk.respond_to?(:path)
                   "#{@command} #{chunk.path}"
                 else
    Severity: Minor
    Found in lib/fluent/plugin/out_exec.rb - About 1 hr to fix

      Method initialize has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def initialize(sender, server, failure:, connection_manager:, ack_handler:)
              @sender = sender
              @log = sender.log
              @compress = sender.compress
              @server = server
      Severity: Minor
      Found in lib/fluent/plugin/out_forward.rb - About 1 hr to fix

        Method build has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def self.build(root_agent)
              log_event_router = nil
        
              begin
                log_event_agent = root_agent.find_label(Fluent::Log::LOG_EVENT_LABEL)
        Severity: Minor
        Found in lib/fluent/fluent_log_event_router.rb - About 1 hr to fix

          Method parser_create has 30 lines of code (exceeds 25 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

            Method formatter_create has 30 lines of code (exceeds 25 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

              Method section_build has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      def section_build(name, config, indent: 0, arg: nil)
                        sb = SectionBodyBuilder.new(indent + @base_indent)
              
                        if (v = config.delete('$type'))
                          sb.add_line('@type', v)
              Severity: Minor
              Found in lib/fluent/config/yaml_parser/parser.rb - About 1 hr to fix

                Method try_connect has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def try_connect
                    begin
                      now = Time.now.to_i
                
                      unless @error_history.empty?
                Severity: Minor
                Found in lib/fluent/command/cat.rb - About 1 hr to fix

                  Method write has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def write(chunk)
                        path = extract_placeholders(@path_template, chunk)
                        FileUtils.mkdir_p File.dirname(path), mode: @dir_perm
                  
                        writer = case
                  Severity: Minor
                  Found in lib/fluent/plugin/out_file.rb - About 1 hr to fix

                    Method check_ping has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def check_ping(message, remote_addr, user_auth_salt, nonce)
                          log.debug "checking ping"
                          # ['PING', self_hostname, shared_key_salt, sha512_hex(shared_key_salt + self_hostname + nonce + shared_key), username || '', sha512_hex(auth_salt + username + password) || '']
                          unless message.size == 6 && message[0] == 'PING'
                            return false, 'invalid ping message'
                    Severity: Minor
                    Found in lib/fluent/plugin/in_forward.rb - About 1 hr to fix

                      Method gen_copy_proc has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def gen_copy_proc
                            @copy_mode = :shallow if @deep_copy
                      
                            case @copy_mode
                            when :no_copy
                      Severity: Minor
                      Found in lib/fluent/plugin/out_copy.rb - About 1 hr to fix

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

                            def configure(conf)
                              super
                        
                              map = {}
                              # <record></record> directive
                        Severity: Minor
                        Found in lib/fluent/plugin/filter_record_transformer.rb - About 1 hr to fix

                          Method install_main_process_command_handlers has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def install_main_process_command_handlers
                                command_pipe = $stdin.dup
                                $stdin.reopen(File::NULL, "rb")
                                command_pipe.binmode
                                command_pipe.sync = true
                          Severity: Minor
                          Found in lib/fluent/supervisor.rb - About 1 hr to fix

                            Method eval_include has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  def eval_include(attrs, elems, uri)
                                    # replace space(s)(' ') with '+' to prevent invalid uri due to space(s).
                                    # See: https://github.com/fluent/fluentd/pull/2780#issuecomment-576081212
                                    u = URI.parse(uri.tr(' ', '+'))
                                    if u.scheme == 'file' || (!u.scheme.nil? && u.scheme.length == 1) || u.path == uri.tr(' ', '+') # file path
                            Severity: Minor
                            Found in lib/fluent/config/v1_parser.rb - About 1 hr to fix

                              Method parse_dot_array_op has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      def self.parse_dot_array_op(key, param)
                                        start = key.index('[')
                                        result = if start.zero?
                                                   []
                                                 else
                              Severity: Minor
                              Found in lib/fluent/plugin_helper/record_accessor.rb - About 1 hr to fix

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

                                      def initialize(target_info, pe, log, read_from_head, follow_inodes, update_watcher, line_buffer_timer_flusher, io_handler_build, metrics)
                                Severity: Major
                                Found in lib/fluent/plugin/in_tail.rb - About 1 hr to fix

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

                                          def initialize(title, wait, timeout, forever, max_steps, randomize, randomize_width, secondary, secondary_threshold)
                                  Severity: Major
                                  Found in lib/fluent/plugin_helper/retry_state.rb - About 1 hr to fix

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

                                            def initialize(title, wait, timeout, forever, max_steps, randomize, randomize_width, secondary, secondary_threshold)
                                    Severity: Major
                                    Found in lib/fluent/plugin_helper/retry_state.rb - About 1 hr to fix

                                      Method update_watcher has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          def update_watcher(tail_watcher, pe, new_inode)
                                            # TODO we should use another callback for this.
                                            # To supress impact to existing logics, limit the case to `@follow_inodes`.
                                            # We may not need `@follow_inodes` condition.
                                            if @follow_inodes && new_inode.nil?
                                      Severity: Minor
                                      Found in lib/fluent/plugin/in_tail.rb - About 1 hr to fix

                                        Method refresh_watchers has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            def refresh_watchers
                                              target_paths_hash = expand_paths
                                              existence_paths_hash = existence_path
                                        
                                              log.debug {
                                        Severity: Minor
                                        Found in lib/fluent/plugin/in_tail.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language