Showing 577 of 664 total issues
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(sock, socket_option_setter, close_callback, log, under_plugin_development, connect_callback)
Avoid deeply nested control flow statements. Open
raise Fluent::ConfigError, "missing array index in '[]'. Invalid syntax: #{param}" if index_value == ']'
Method error_sample
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def error_sample
pos = @ss.pos
lines = @ss.string.lines.to_a
lines.each_with_index { |line, ln|
- 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_embedded_code
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def scan_embedded_code
src = '"#{'+@ss.rest+"\n=begin\n=end\n}"
seek = -1
while (seek = src.index('}', seek + 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 dump_value
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def dump_value(k, v, nindent)
return "#{nindent}#{k} xxxxxx\n" if secret_param?(k)
return "#{nindent}#{k} #{v}\n" unless @v1_config
# for v1 config
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_step_by_step(metadata, data, format, splits_count, &block)
Method build_request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def build_request(method, id, scope = nil, params = nil, options = nil)
Method placeholder_validators
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def placeholder_validators(name, str, time_key = (@chunk_key_time && @buffer_config.timekey), tag_key = @chunk_key_tag, chunk_keys = @chunk_keys)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(file, file_mutex, seek, pos, inode)
Method socket_create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def socket_create(proto, host, port, **kwargs, &block)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(name, arg, attrs, elements, unused = nil)
Method call
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def call
if Fluent.windows?
if /^[0-9]+$/.match?(@pid_or_svcname)
# Use as PID
return call_windows_event(@command, "fluentd_#{@pid_or_svcname}")
- 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 invoke
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def invoke(sock, ri, data)
@log.trace __callee__
case ri.state
when :helo
- 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 on_notify
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def on_notify(stat)
if stat.nil?
inode = nil
fsize = 0
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 make_request_cached
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def make_request_cached(uri, req)
id = self.connection_cache_id_for_thread
if id.nil?
@connection_cache_id_mutex.synchronize {
id = @connection_cache_next_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 drop_capabilities
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def drop_capabilities(opts, target_file)
if drop_caps = opts[:drop_capabilities]
@capng.clear(:caps)
@capng.caps_file(target_file)
capabilities = drop_caps.split(/\s*,\s*/)
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def start
@thread = ::Thread.new {
until @flag.wait_for_set(0.5)
now = Time.now
@mutex.synchronize {
- 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 copy_license
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def copy_license
# in gem_name directory
return unless license_name
puts "License: #{license_name}"
license_class = self.class.lookup_license(license_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 select_healthy_node
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def select_healthy_node
error = nil
# Don't care about the change of @weight_array's size while looping since
# it's only used for determining the number of loops and it is not so important.
- 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 build_option
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def build_option(req)
qs = Hash.new { |_, _| [] }
# parse ?=query string
if req.query_string
qs.merge!(CGI.parse(req.query_string))
- 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"