Showing 69 of 69 total issues
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return false
Method server_setting
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def server_setting
if svrs = @config[:servers]
svl = []
svrs.each{|si|
ports = si[:port] || 6667
- 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_entries
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_entries
et = @entry_time
res = []
CSV::Reader.parse(read_content){|row|
last_detected = Time.at(row[2].data.to_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 send_from_client
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def send_from_client msg, from
until @manager.connected
# ignore
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 make_default_logwriter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def make_default_logwriter
if @config[:default_log].kind_of? Hash
dl = @config[:default_log]
else
# defult_log must be Hash
- 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 nadoka_client_command
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def nadoka_client_command cmd, args
cmd ||= ''
case cmd.upcase
when 'QUIT'
@manager.invoke_event :quit_program
- 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_mode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def on_mode nick, args
while mode = args.shift
modes = mode.split(//)
flag = modes.shift
modes.each{|m|
- 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 read_content
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def read_content
case @uri.scheme
when 'http', 'https'
open(@uri){|f|
if f.content_encoding.any?{|e| /gzip/ =~ e}
- 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"