Showing 333 of 491 total issues
Method ev_alist_join_with_time
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def ev_alist_join_with_time(s)
hname, k, d, vn, nodes = calc_hash(s[1])
data = read_bytes(s[2].to_i)
read_bytes(2)
return forward1(nodes[0], s, data) if nodes[0] != @nid
- 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 ev_alist_gets_with_time
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def ev_alist_gets_with_time(s)
hname, k, d, vn, nodes = calc_hash(s[1])
return forward1(nodes[0], s) if nodes[0] != @nid
ddata = @storages[hname].get(vn, k, 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 ev_alist_gets
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def ev_alist_gets(s)
hname, k, d, vn, nodes = calc_hash(s[1])
return forward1(nodes[0], s) if nodes[0] != @nid
ddata = @storages[hname].get(vn, k, 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 ev_alist_join
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def ev_alist_join(s)
hname, k, d, vn, nodes = calc_hash(s[1])
data = read_bytes(s[2].to_i)
read_bytes(2)
return forward1(nodes[0], s, data) if nodes[0] != @nid
- 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 storage_cachecleaning_process
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def storage_cachecleaning_process(hname, dn)
count = 0
rcount = 0
st = @storages[hname]
- 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 def_write_command_with_key_value
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
def def_write_command_with_key_value(cmd, idx_of_val_len, forward = :one_line, &block)
define_method "ev_#{cmd}" do |s|
return send_data("CLIENT_ERROR does not find key\r\n") if s.length < 2
begin
params = CommandParams.new
Class Handler
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Handler < EventMachine::Connection
@@ev_list={}
def self.ev_list; @@ev_list; end
@@system_commands={}
def self.system_commands; @@system_commands; end
File write_behind.rb
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'thread'
require 'roma/stats'
require 'socket'
require 'roma/messaging/con_pool'
require 'timeout'
Method def_write_command_with_key
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def def_write_command_with_key(cmd, forward = :one_line, &block)
define_method "ev_#{cmd}" do |s|
return send_data("CLIENT_ERROR does not find key\r\n") if s.length < 2
begin
params = CommandParams.new
Method upload_data2
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def upload_data2(hname, nid, keys)
con = Roma::Messaging::ConPool.instance.get_connection(nid)
cmd = "#{@pushv_cmd} #{hname} 0\r\n"
con.write(cmd)
- 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 ev_spushv
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ev_spushv(s)
if s.length != 3
@log.error("#{__method__}:wrong number of arguments(#{s})")
return send_data("CLIENT_ERROR Wrong number of arguments.\r\n")
end
Method ev_alist_to_s
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def ev_alist_to_s(s)
hname, k, d, vn, nodes = calc_hash(s[1])
return forward1(nodes[0], s) if nodes[0] != @nid
ddata = @storages[hname].get(vn, k, 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 store_result
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def store_result(results, base, hash, input)
target = base[hash]
return results if !target["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 get_point
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_point(f, target_time, type, latency_time = Time.now, current_pos = 0, new_pos = f.size / 2)
# hilatency check
ps = Time.now - latency_time
if ps > 5
@log.warn('gather_logs process was failed.')
File rt_command_receiver.rb
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Roma
module Command
module RoutingCommandReceiver
Method ev_rswitch_replication
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def ev_rswitch_replication(s)
unless s.length.between?(2, 4)
return send_data("CLIENT_ERROR number of arguments\n\r")
end
unless s[1] =~ /^(true|false)$/
- 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 ev_set_storage_status
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def ev_set_storage_status(s)
if s.length < 3
return send_data("CLIENT_ERROR number of arguments (#{s.length - 1} for 2)\r\n")
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 def_command_with_key_value
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def def_command_with_key_value(cmd, idx_of_val_len, forward = :one_line, &block)
define_method "ev_#{cmd}" do |s|
return send_data("CLIENT_ERROR does not find key\r\n") if s.length < 2
begin
params = CommandParams.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 ev_alist_expired_swap_and_sized_push
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def ev_alist_expired_swap_and_sized_push(s)
hname, k, d, vn, nodes = calc_hash(s[1])
data = read_bytes(s[4].to_i)
read_bytes(2)
return forward2(nodes[0], s, data) if nodes[0] != @nid
- 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 ev_fdelete
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def ev_fdelete(s)
key,hname = s[1].split("\e")
hname ||= @defhash
d = Digest::SHA1.hexdigest(key).hex % @rttable.hbits
vn = @rttable.get_vnode_id(d)
- 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"