Showing 565 of 654 total issues
Method synchronize
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def synchronize(*keys)
return if keys.empty?
locks = {}
loop do
- 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_tls_accept
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def try_tls_accept
return true if @_handler_accepted
begin
result = @_handler_socket.accept_nonblock(exception: false) # this method call actually try to do handshake via TLS
- 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 calc_next_time
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def calc_next_time
if @forever || !@secondary # primary
naive = naive_next_time(@steps)
if @forever
naive
- 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 dump_config_definition
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def dump_config_definition
dumped_config = {}
if @argument
argument_name, _block, options = @argument
options[:required] = !@defaults.key?(argument_name)
- 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 compat_parameters_parser
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def compat_parameters_parser(conf)
return unless conf.elements('parse').empty?
return if PARSER_PARAMS.keys.all?{|k| !conf.has_key?(k) }
# TODO: warn obsolete parameters if these are deprecated
- 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 compat_parameters_extract
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def compat_parameters_extract(conf)
return unless conf.elements('extract').empty?
return if EXTRACT_PARAMS.keys.all?{|k| !conf.has_key?(k) } && !conf.has_key?('format')
# TODO: warn obsolete parameters if these are deprecated
- 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 scan_double_quoted_string
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def scan_double_quoted_string
string = []
while true
if skip(/\"/)
if string.include?(nil)
- 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 install_windows_event_handler
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def install_windows_event_handler
return unless Fluent.windows?
@pid_signame = "fluentd_#{Process.pid}"
@signame = config[:signame]
Method child_process_execute_once
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
title, command, arguments, subprocess_name, mode, stderr, env, unsetenv, chdir,
internal_encoding, external_encoding, scrub, replace_string, wait_timeout, on_exit_callback, &block
Method configure
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def configure(conf)
super
if @source_hostname_key
# TODO: add test
Method configure
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def configure(conf)
bufconf = CompatOutputUtils.buffer_section(conf)
config_style = (bufconf ? :v1 : :v0)
if config_style == :v0
buf_params = {
Method parse
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def parse(text, &block)
loop do
m =
if @unmatched_lines
@parser.call(text) do |time, record|
- 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 filter_stream
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def filter_stream(tag, es)
new_es = MultiEventStream.new
if @has_filter_with_time
es.each do |time, record|
begin
- 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 lifecycle
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def lifecycle(desc: false, kind_callback: nil)
kind_or_label_list = if desc
[:output, :filter, @labels.values.reverse, :output_with_router, :input].flatten
else
[:input, :output_with_router, @labels.values, :filter, :output].flatten
- 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 section_build
has a Cognitive Complexity of 15 (exceeds 5 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)
- 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 parse_dot_array_op
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def self.parse_dot_array_op(key, param)
start = key.index('[')
result = if start.zero?
[]
else
- 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 write_once
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def write_once(metadata, data, format: nil, size: nil, &block)
return if data.empty?
stored = false
adding_bytesize = nil
Method flush_thread_run
has 47 lines of code (exceeds 25 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
Method on_rotate
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def on_rotate(stat)
if @io_handler.nil?
if stat
# first time
fsize = stat.size
Method get_monitor_info
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_monitor_info(pe, opts={})
obj = {}
# Common plugin information
obj['plugin_id'] = pe.plugin_id