Showing 577 of 664 total issues
Method get_monitor_info
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def get_monitor_info(pe, opts={})
obj = {}
# Common plugin information
obj['plugin_id'] = pe.plugin_id
- 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 21 (exceeds 5 allowed). Consider refactoring. Open
def configure(conf)
super
@connection_cache = Array.new(actual_flush_thread_count, ConnectionCache.new("", nil)) if @reuse_connections
- 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_multilines
has a Cognitive Complexity of 21 (exceeds 5 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
- 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 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
def configure(conf)
compat_parameters_convert(conf, :formatter, :buffer, :inject, default_chunk_key: "time")
configured_time_slice_format = conf['time_slice_format']
Method generate_path_template
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def generate_path_template(original, timekey, append, compress, path_suffix: '', time_slice_format: nil)
comp_suffix = compression_suffix(compress)
index_placeholder = append ? '' : '_**'
if original.index('*')
raise "BUG: configuration error must be raised for path including '*' without timekey" unless timekey
- 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 resume
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def resume
stage = {}
queue = []
exist_broken_file = false
- 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 flush_thread_run
has a Cognitive Complexity of 20 (exceeds 5 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
- 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 20 (exceeds 5 allowed). Consider refactoring. Open
def configure(conf)
bufconf = CompatOutputUtils.buffer_section(conf)
config_style = (bufconf ? :v1 : :v0)
if config_style == :v0
buf_params = {
- 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 storage_create
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def storage_create(usage: '', type: nil, conf: nil, default_type: nil)
if conf && conf.respond_to?(:arg) && !conf.arg.empty?
usage = conf.arg
end
if !usage.empty? && usage !~ /^[a-zA-Z][-_.a-zA-Z0-9]*$/
- 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_buffer
has a Cognitive Complexity of 20 (exceeds 5 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) }
- 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 67 lines of code (exceeds 25 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|
File cat.rb
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'optparse'
require 'fluent/env'
require 'fluent/time'
require 'fluent/msgpack_factory'
require 'fluent/version'
Class ForwardOutput
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class ForwardOutput < Output
Fluent::Plugin.register_output('forward', self)
helpers :socket, :server, :timer, :thread, :compat_parameters, :service_discovery
Class FileSingleChunk
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class FileSingleChunk < Chunk
class FileChunkError < StandardError; end
## buffer path user specified : /path/to/directory
## buffer chunk path : /path/to/directory/fsb.key.b513b61c9791029c2513b61c9791029c2.buf
Method setup_global_logger
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_global_logger(supervisor: false)
if supervisor
worker_id = 0
process_type = :supervisor
else
File storage.rb
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'forwardable'
require 'fluent/plugin'
require 'fluent/plugin/storage'
require 'fluent/plugin_helper/timer'
Method call
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def call
parse_options!
FileUtils.mkdir_p(gem_name)
Dir.chdir(gem_name) do
copy_license
- 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_line_to_event
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def convert_line_to_event(line, es, tail_watcher)
begin
line.chomp! # remove \n
@parser.parse(line) { |time, record|
if 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 configure
has a Cognitive Complexity of 19 (exceeds 5 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
- 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_supervisor
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def run_supervisor(dry_run: false)
if dry_run
$log.info "starting fluentd-#{Fluent::VERSION} as dry run mode", ruby: RUBY_VERSION
end
- 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"