Showing 577 of 664 total issues
Method cert_option_create_context
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Method try_write
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def try_write(chunk)
tmpfile = nil
prog = if chunk.respond_to?(:path)
"#{@command} #{chunk.path}"
else
Method initialize
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(sender, server, failure:, connection_manager:, ack_handler:)
@sender = sender
@log = sender.log
@compress = sender.compress
@server = server
Method build
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.build(root_agent)
log_event_router = nil
begin
log_event_agent = root_agent.find_label(Fluent::Log::LOG_EVENT_LABEL)
Method parser_create
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def parser_create(usage: '', type: nil, conf: nil, default_type: nil)
parser = @_parsers[usage]
return parser if parser && !type && !conf
type = if type
Method formatter_create
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def formatter_create(usage: '', type: nil, conf: nil, default_type: nil)
formatter = @_formatters[usage]
return formatter if formatter && !type && !conf
type = if type
Method section_build
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Method try_connect
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def try_connect
begin
now = Time.now.to_i
unless @error_history.empty?
Method write
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def write(chunk)
path = extract_placeholders(@path_template, chunk)
FileUtils.mkdir_p File.dirname(path), mode: @dir_perm
writer = case
Method check_ping
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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'
Method gen_copy_proc
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def gen_copy_proc
@copy_mode = :shallow if @deep_copy
case @copy_mode
when :no_copy
Method configure
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def configure(conf)
super
map = {}
# <record></record> directive
Method install_main_process_command_handlers
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def install_main_process_command_handlers
command_pipe = $stdin.dup
$stdin.reopen(File::NULL, "rb")
command_pipe.binmode
command_pipe.sync = true
Method eval_include
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Method parse_dot_array_op
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.parse_dot_array_op(key, param)
start = key.index('[')
result = if start.zero?
[]
else
Method initialize
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def initialize(target_info, pe, log, read_from_head, follow_inodes, update_watcher, line_buffer_timer_flusher, io_handler_build, metrics)
Method initialize
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def initialize(title, wait, timeout, forever, max_steps, randomize, randomize_width, secondary, secondary_threshold)
Method initialize
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def initialize(title, wait, timeout, forever, max_steps, randomize, randomize_width, secondary, secondary_threshold)
Method update_watcher
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
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?
Method refresh_watchers
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def refresh_watchers
target_paths_hash = expand_paths
existence_paths_hash = existence_path
log.debug {