Showing 69 of 69 total issues
Method log_format_message
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def log_format_message msgfmts, msgobj
type = msgobj[:type]
format = msgfmts.fetch(type, @config[:default_log][:message_format][type])
if format.kind_of? Proc
Method login
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def login
pass = nil
nick = nil
@username = nil
Method load_bots
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def load_bots
# for compatibility
return load_bots_old if @config[:botconfig].kind_of? Hash
@bots = @config[:botconfig].map{|bot|
if bot.kind_of? 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 load_bots_old
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def load_bots_old
(@config[:botfiles] + (@config[:defaultbotfiles]||[])).each{|file|
load_botfile 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 start
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def start
send_thread = Thread.new{
begin
while q = @queue.pop
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 send_to_bot
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def send_to_bot msg, *arg
selector = 'on_' +
if msg.respond_to? :command
if /^\d+$/ =~ msg.command
Method logging
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def logging msg
user = @manager.nick_of(msg)
rch = msg.params[0]
ch = @config.canonical_channel_name(rch)
Method start
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start
send_thread = Thread.new{
begin
while q = @queue.pop
begin
Method login
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def login
pass = nil
nick = nil
@username = 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 channel_setting
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def channel_setting
# treat with channel information
if chs = @config[:channel_info]
dchs = []
lchs = []
- 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 recv_from_client
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def recv_from_client
while !@sock.closed?
begin
str = @sock.gets
if str
- 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 open_conn
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def open_conn
@conn.synchronize do
conn = TCPSocket.new(@server, @port)
if ssl_params
context = OpenSSL::SSL::SSLContext.new
- 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 to_s
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def to_s
str = ''
if @prefix
str << ':'
str << @prefix
- 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
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def self.parse(str)
unless PATTERN::MESSAGE_PATTERN =~ str
raise InvalidMessage, "Invalid message: #{str.inspect}"
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 enter_away
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def enter_away
return if @exitting || !@connected
send_to_server Cmd.away(@config.away_message) if @config.away_message
- 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_thread
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def read_thread(read_q, eol)
begin
read_q.clear
Thread.stop
Method filter_message
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def filter_message filter, msg
return msg if filter.nil? || filter.empty?
begin
if filter.respond_to? :each
Method initialize
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(server, port, eol = "\r\n", ssl_params = nil)
@conn = []
@conn.extend(MonitorMixin)
@main_th = nil
Method start
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start(max_retry = 3, retry_wait = 30)
@client_th = Thread.current # caller thread
if alive?
#sleep retry_wait
return nil
Method remove_previous_setting
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def remove_previous_setting
# remove setting class
base_klass = ConfigClass.shift
while klass = ConfigClass.shift
Object.module_eval{