Showing 664 of 664 total issues
Class ConfigureProxy
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class ConfigureProxy
attr_accessor :name, :final, :param_name, :init, :required, :multi, :alias, :configured_in_section
attr_accessor :argument, :params, :defaults, :descriptions, :sections
# config_param :desc, :string, default: '....'
# config_set_default :buffer_type, :memory
Method start
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start
super
if @buffering.nil?
@buffering = prefer_buffered_processing
Method start
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start
super
@children_mutex = Mutex.new
@children = []
Method shutdown
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def shutdown(kind_or_agent_list: nil)
# Fluentd's shutdown sequence is stop, before_shutdown, shutdown, after_shutdown, close, terminate for plugins
# These method callers does `rescue Exception` to call methods of shutdown sequence as far as possible
# if plugin methods does something like infinite recursive call, `exit`, unregistering signal handlers or others.
# Plugins should be separated and be in sandbox to protect data in each plugins/buffers.
Method dump_section_markdown
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def dump_section_markdown(base_section, level = 0)
dumped = ""
if base_section[:section]
sections = []
params = base_section
- 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_section_txt
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def dump_section_txt(base_section, level = 0)
dumped = ""
indent = " " * level
if base_section[:section]
sections = []
- 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 handle_connection
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def handle_connection(conn)
send_data = ->(serializer, data){ conn.write serializer.call(data) }
log.trace "connected fluent socket", addr: conn.remote_addr, port: conn.remote_port
state = :established
- 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 <=>
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def <=>(o)
timekey2 = o.timekey
tag2 = o.tag
variables2 = o.variables
if (!!timekey ^ !!timekey2) || (!!tag ^ !!tag2) || (!!variables ^ !!variables2)
- 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 refresh_watchers
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def refresh_watchers
target_paths_hash = expand_paths
existence_paths_hash = existence_path
log.debug {
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
def start
super
if @buffering.nil?
@buffering = prefer_buffered_processing
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
def initialize(format = nil, localtime = true, timezone = nil)
if format.nil? && (timezone || !localtime)
raise Fluent::ConfigError, "specifying timezone requires time format"
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"
Further reading
Method hash_value
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.hash_value(val, opts = {}, name = nil)
return nil if val.nil?
param = if val.is_a?(String)
val.start_with?('{') ? JSON.parse(val) : Hash[val.strip.split(/\s*,\s*/).map{|v| v.split(':', 2)}]
- 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 check_unused_section
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.check_unused_section(proxy, conf, plugin_class)
elems = conf.respond_to?(:elements) ? conf.elements : []
elems.each { |e|
next if plugin_class.nil? && Fluent::Config::V1Parser::ELEM_SYMBOLS.include?(e.name) # skip pre-defined non-plugin elements because it doesn't have proxy section
next if e.unused_in && e.unused_in.empty? # the section is used at least once
- 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 close
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def close
while true
pids = @_child_process_mutex.synchronize{ @_child_process_processes.keys }
break if pids.size < 1
- 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 server_create
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def server_create(title, port, proto: nil, bind: '0.0.0.0', shared: true, socket: nil, backlog: nil, tls_options: nil, max_bytes: nil, flags: 0, **socket_options, &callback)
proto ||= (@transport_config && @transport_config.protocol == :tls) ? :tls : :tcp
raise ArgumentError, "BUG: title must be a symbol" unless title && title.is_a?(Symbol)
raise ArgumentError, "BUG: port must be an integer" unless port && port.is_a?(Integer)
File out_exec_filter.rb
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'fluent/plugin/output'
require 'fluent/env'
require 'fluent/config/error'
require 'yajl'
Class EventTime
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class EventTime
TYPE = 0
FORMATTER = Strftime.new('%Y-%m-%d %H:%M:%S.%N %z')
def initialize(sec, nsec = 0)
Class EngineClass
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class EngineClass
# For compat. remove it in fluentd v2
include Fluent::MessagePackFactory::Mixin
def initialize
Method enqueue_thread_run
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def enqueue_thread_run
value_for_interval = nil
if @flush_mode == :interval
value_for_interval = @buffer_config.flush_interval
end
Method configure
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def configure(conf)
super
@on_memory = false
if @path