Showing 577 of 664 total issues
Method run_once
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def run_once
# Don't care race in this loop intentionally
s = @queue.size
if s == 0
- 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_message
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def handle_message(msg)
service = msg.service
case msg.type
when Fluent::Plugin::ServiceDiscovery::SERVICE_IN
- 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 extract_tag_from_record
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def extract_tag_from_record(record)
return nil unless @_extract_enabled
if @_extract_tag_key && record.has_key?(@_extract_tag_key)
v = @_extract_keep_tag_key ? record[@_extract_tag_key] : record.delete(@_extract_tag_key)
- 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_single_quoted_string
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def scan_single_quoted_string
string = []
while true
if skip(/\'/)
return string.join
- 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 extract_time_from_record
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def extract_time_from_record(record)
return nil unless @_extract_enabled
if @_extract_time_key && record.has_key?(@_extract_time_key)
v = @_extract_keep_time_key ? record[@_extract_time_key] : record.delete(@_extract_time_key)
- 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
Avoid too many return
statements within this method. Open
return info, Result::SUCCESS
Avoid too many return
statements within this method. Open
return -1
Avoid too many return
statements within this method. Open
return 1
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return if record.nil?
Avoid too many return
statements within this method. Open
return true, shared_key_salt, shared_key
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 Proc.new {|time|
time = time.to_time
time.localtime(tz.period_for_utc(time).utc_total_offset).iso8601
}
Avoid too many return
statements within this method. Open
return false
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 nil
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"