fluent/fluentd

View on GitHub

Showing 577 of 664 total issues

Method install_main_process_command_handlers has a Cognitive Complexity of 9 (exceeds 5 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 55 mins to fix

Method build_spawn_command has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def build_spawn_command
if ENV['TEST_RUBY_PATH']
fluentd_spawn_cmd = [ENV['TEST_RUBY_PATH']]
else
fluentd_spawn_cmd = [ServerEngine.ruby_bin_path]
Severity: Minor
Found in lib/fluent/supervisor.rb - About 55 mins to fix

Method mount_proc has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def mount_proc(path, &block)
@server.mount_proc(path) { |req, res|
begin
code, header, response = block.call(req, res)
rescue => e
Severity: Minor
Found in lib/fluent/rpc.rb - About 55 mins to fix

Method error has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def error(*args, &block)
return if @level > LEVEL_ERROR
type = log_type(args)
return if skipped_type?(type)
args << block.call if block
Severity: Minor
Found in lib/fluent/log.rb - About 55 mins to fix

Method fatal has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def fatal(*args, &block)
return if @level > LEVEL_FATAL
type = log_type(args)
return if skipped_type?(type)
args << block.call if block
Severity: Minor
Found in lib/fluent/log.rb - About 55 mins to fix

Method convert_parser_conf has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def self.convert_parser_conf(conf)
return if conf.elements(name: 'parse').first
 
parser_params = {}
PARSER_PARAMS.each do |older, newer|
Severity: Minor
Found in lib/fluent/compat/parser_utils.rb - About 55 mins to fix

Method configure has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def configure(conf)
super
 
if plugin_id_configured? || conf['@log_level']
@log = PluginLogger.new($log.dup) unless @log.is_a?(PluginLogger)
Severity: Minor
Found in lib/fluent/log.rb - About 55 mins to fix

Method trace has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def trace(*args, &block)
return if @level > LEVEL_TRACE
type = log_type(args)
return if skipped_type?(type)
args << block.call if block
Severity: Minor
Found in lib/fluent/log.rb - About 55 mins to fix

Method debug has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def debug(*args, &block)
return if @level > LEVEL_DEBUG
type = log_type(args)
return if skipped_type?(type)
args << block.call if block
Severity: Minor
Found in lib/fluent/log.rb - About 55 mins to fix

Method warn has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def warn(*args, &block)
return if @level > LEVEL_WARN
type = log_type(args)
return if skipped_type?(type)
args << block.call if block
Severity: Minor
Found in lib/fluent/log.rb - About 55 mins to fix

Method info has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def info(*args, &block)
return if @level > LEVEL_INFO
type = log_type(args)
return if skipped_type?(type)
args << block.call if block
Severity: Minor
Found in lib/fluent/log.rb - About 55 mins to fix

Method on_message has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def on_message(msg, addr)
@parser.parse(msg) { |time, record|
unless time && record
log.warn "pattern not matched: #{msg.inspect}"
return
Severity: Minor
Found in lib/fluent/compat/socket_util.rb - About 55 mins to fix

Method add_match has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def add_match(type, pattern, conf)
log_type = conf.for_this_worker? ? :default : :worker0
log.info log_type, "adding match#{@context.nil? ? '' : " in #{@context}"}", pattern: pattern, type: type
 
output = Plugin.new_output(type)
Severity: Minor
Found in lib/fluent/agent.rb - About 55 mins to fix

Method set_version_to_context has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def set_version_to_context(ctx, version, min_version, max_version)
if MIN_MAX_AVAILABLE
case
when min_version.nil? && max_version.nil?
min_version = METHODS_MAP[version] || version
Severity: Minor
Found in lib/fluent/tls.rb - About 55 mins to fix

Method convert_value_to_nil has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def convert_value_to_nil(value)
if value && @null_empty_string
value = (value == '') ? nil : value
end
if value && @null_value_pattern
Severity: Minor
Found in lib/fluent/compat/parser.rb - About 55 mins to fix

Method process_include has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def process_include(attrs, elems, uri, allow_include = true)
u = URI.parse(uri)
if u.scheme == 'file' || u.path == uri # file path
path = u.path
if path[0] != ?/
Severity: Minor
Found in lib/fluent/config/parser.rb - About 55 mins to fix

Method array_value has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def self.array_value(val, opts = {}, name = nil)
return nil if val.nil?
 
param = if val.is_a?(String)
val.start_with?('[') ? JSON.parse(val) : val.strip.split(/\s*,\s*/)
Severity: Minor
Found in lib/fluent/config/types.rb - About 55 mins to fix

Method configure has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def configure(conf)
super
 
if @extract_config
@_extract_tag_key = @extract_config.tag_key
Severity: Minor
Found in lib/fluent/plugin_helper/extract.rb - About 55 mins to fix

Method parse has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def self.parse(path)
context = Kernel.binding
 
unless context.respond_to?(:use_nil)
context.define_singleton_method(:use_nil) do
Severity: Minor
Found in lib/fluent/config/yaml_parser.rb - About 55 mins to fix

Method parse_plain has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

def parse_plain(re, time, text, idx, record, capture_list, &block)
Severity: Major
Found in lib/fluent/plugin/parser_syslog.rb - About 50 mins to fix
    Severity
    Category
    Status
    Source
    Language