Showing 577 of 664 total issues
Method lifecycle
has a Cognitive Complexity of 33 (exceeds 5 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?
- 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 child_process_execute_once
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
def child_process_execute_once(
title, command, arguments, subprocess_name, mode, stderr, env, unsetenv, chdir,
internal_encoding, external_encoding, scrub, replace_string, wait_timeout, on_exit_callback, &block
)
spawn_args = if arguments || subprocess_name
Method configure
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def configure(conf)
super
if @source_hostname_key
# TODO: add test
- 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_rfc5424
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def parse_rfc5424(text, &block)
pri = nil
cursor = 0
if @with_priority
if text.start_with?('<'.freeze)
- 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_rfc3164
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def parse_rfc3164(text, &block)
pri = nil
cursor = 0
if @with_priority
if text.start_with?('<'.freeze)
- 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_formatter_conf
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def self.convert_formatter_conf(conf)
return if conf.elements(name: 'inject').first || conf.elements(name: 'format').first
inject_params = {}
INJECT_PARAMS.each do |older, newer|
- 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_step_by_step
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
def write_step_by_step(metadata, data, format, splits_count, &block)
splits = []
if splits_count > data.size
splits_count = data.size
end
Method extract_placeholders
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def extract_placeholders(str, chunk)
metadata = if chunk.is_a?(Fluent::Plugin::Buffer::Chunk)
chunk_passed = true
chunk.metadata
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 configure
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def configure(conf)
super
@variable_store = Fluent::VariableStore.fetch_or_build(:buf_file_single)
- 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 start
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def start
super
@children_mutex = Mutex.new
@children = []
- 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 30 (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 initialize
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def initialize(pat)
if pat.start_with?('/')
if pat.end_with?('/')
@regex = Regexp.new("\\A"+pat[1..-2]+"\\Z")
return
- 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 generate
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.generate(proxy, conf, logger, plugin_class, stack = [], strict_config_value = false)
return nil if conf.nil?
section_stack = ""
unless stack.empty?
File root_agent.rb
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'delegate'
require 'fluent/config/error'
require 'fluent/agent'
require 'fluent/label'
Method flush_buffer
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def flush_buffer(tw, buf)
buf.chomp!
@parser.parse(buf) { |time, record|
if time && record
tag = if @tag_prefix || @tag_suffix
- 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_fast_internal
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def parse_fast_internal(text)
record = {}
text.chomp!
return record if text.empty?
- 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 optimized_filter_stream
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def optimized_filter_stream(tag, es)
new_es = MultiEventStream.new
es.each(unpacker: Fluent::MessagePackFactory.thread_local_msgpack_unpacker) do |time, record|
filtered_record = record
filtered_time = time
- 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_bracket_notation
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def self.parse_bracket_notation(param)
orig_param = param
result = []
param = param[1..-1]
in_bracket = 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
Class FluentPluginGenerator
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class FluentPluginGenerator
attr_reader :type, :name
attr_reader :license_name
SUPPORTED_TYPES = ["input", "output", "filter", "parser", "formatter", "storage"]
Method parse_rfc5424
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_rfc5424(text, &block)
pri = nil
cursor = 0
if @with_priority
if text.start_with?('<'.freeze)