Showing 664 of 664 total issues
Method dump_config_definition
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dump_config_definition
dumped_config = {}
if @argument
argument_name, _block, options = @argument
options[:required] = !@defaults.key?(argument_name)
Method message_handler
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def message_handler(data, sock)
pri = nil
text = data
unless @parser_parse_priority
m = SYSLOG_REGEXP.match(data)
Method read_lines
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def read_lines(lines)
idx = @buffer.index(@eol)
has_skipped_line = false
until idx.nil?
Method compat_parameters_buffer
has 38 lines of code (exceeds 25 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) }
Method parameter_configuration
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parameter_configuration(name, type = nil, **kwargs, &block)
config_parameter_option_validate!(name, type, **kwargs, &block)
name = name.to_sym
Method merge
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def merge(other) # self is base class, other is subclass
return merge_for_finalized(other) if self.final?
[:param_name, :required, :multi, :alias, :configured_in_section].each do |prohibited_name|
if overwrite?(other, prohibited_name)
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
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 = {}
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,
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
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
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
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?
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)
- Read upRead up
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]
- Read upRead up
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
- Read upRead up
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
- Read upRead up
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 = {}
- Read upRead up
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
- Read upRead up
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|
- Read upRead up
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"