Showing 565 of 654 total issues
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return Proc.new {|time|
time = time.to_time
format.exec(time.localtime(tz.period_for_utc(time).utc_total_offset))
}
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return Proc.new {|time|
time = time.to_time
time.localtime(tz.period_for_utc(time).utc_total_offset).strftime(format)
}
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return Proc.new {|time|
time = time.to_time
time.localtime(tz.period_for_utc(time).utc_total_offset).iso8601
}
Method on_record
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def on_record(time, record)
tag = extract_tag_from_record(record)
tag ||= @tag
time ||= extract_time_from_record(record) || Fluent::EventTime.now
router.emit(tag, 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 filter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def filter(tag, time, record)
begin
if @_regexp_and_conditions && @_regexp_and_conditions.any? { |expression| !expression.match?(record) }
return nil
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 overwrite?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def overwrite?(dest)
return true if @overwrite_all
loop do
print "Overwrite #{dest}? (enter \"h\" for help) [Ynaqh]"
answer = $stdin.gets.chomp
- 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 plugin_info_by_tag
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def plugin_info_by_tag(tag, opts={})
matches = Fluent::Engine.root_agent.event_router.instance_variable_get(:@match_rules)
matches.each { |rule|
if rule.match?(tag)
if rule.collector.is_a?(Fluent::Plugin::Output) || rule.collector.is_a?(Fluent::Output)
- 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 construct_watcher
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def construct_watcher(target_info)
path = target_info.path
# The file might be rotated or removed after collecting paths, so check inode again here.
begin
- 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 template
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def template(source, dest)
dest.dirname.mkpath
contents =
if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
ERB.new(source.read, trim_mode: "-")
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def on_notify(tw)
unless @start && @flush_method
return
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 parse_formats
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_formats(conf)
check_format_range(conf)
prev_format = nil
(1..FORMAT_MAX_NUM).map { |i|
- 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 call
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def call
parse_options!(@argv)
target_file = if !!@opts[:target_file]
@opts[:target_file]
- 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 purge_obsolete_socks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def purge_obsolete_socks
sockets = []
@mutex.synchronize do
# don't touch @inflight_sockets
- 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_encoding
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def configure_encoding
unless @encoding
if @from_encoding
raise Fluent::ConfigError, "tail: 'from_encoding' parameter must be specified with 'encoding' parameter."
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 close
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def close(sock)
if @socket_cache
@socket_cache.checkin(sock)
else
sock.close_write rescue nil
- 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 render_ltsv
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def render_ltsv(obj, code: 200)
normalized = JSON.parse(obj.to_json)
text = ''
normalized.each do |hash|
row = []
- 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"