Showing 333 of 491 total issues
File sys_command_receiver.rb
has 1149 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'roma/async_process'
module Roma
module Command
File plugin_alist.rb
has 1085 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'timeout'
require 'roma/messaging/con_pool'
require 'json'
module Roma
File async_process.rb
has 926 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'thread'
require 'digest/sha1'
require 'timeout'
module Roma
File romad.rb
has 692 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'optparse'
require 'roma/version'
require 'roma/stats'
require 'roma/command_plugin'
require 'roma/async_process'
File plugin_storage.rb
has 623 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'zlib'
require 'digest/sha1'
require 'roma/async_process'
module Roma
File basic_storage.rb
has 615 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'digest/sha1'
require 'thread'
require 'fileutils'
module Roma
Method start
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
def start
# config version check
if !Config.const_defined?(:VERSION)
@log.error("ROMA FAIL TO BOOT! : config.rb's version is too old.")
exit
- 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
File mkconfig.rb
has 519 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'pathname'
require 'yaml'
require 'fileutils'
module Roma
Method ev_spushv
has a Cognitive Complexity of 50 (exceeds 5 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
- 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 each_clean_up
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def each_clean_up(t, vnhash)
@do_clean_up = true
f = nil;
if @cleanup_regexp && File.exist?(@storage_path)
- 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
Class BasicStorage
has 52 methods (exceeds 20 allowed). Consider refactoring. Open
class BasicStorage
attr_reader :hdb
attr_reader :hdiv
attr_reader :ext_name
Method dispatcher
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def dispatcher
@stats = Roma::Stats.instance
#@log.debug("Roma::Event::Handler.dipatcher called")
while(@connected) do
@enter_time = 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
File command_definition.rb
has 391 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Roma
module Command
module Definition
class ClientErrorException < Exception; end
Method def_write_command_with_key
has a Cognitive Complexity of 34 (exceeds 5 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
- 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 a Cognitive Complexity of 34 (exceeds 5 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
- 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 async_send_cmd
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def async_send_cmd(nid, cmd, tout=nil)
con = res = nil
if tout
Timeout.timeout(tout){
con = Roma::Messaging::ConPool.instance.get_connection(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_clean_up_process
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def storage_clean_up_process
@log.info("#{__method__}:start")
me = @stats.ap_str
vnhash = {}
@rttable.each_vnode do |vn, nids|
- 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
Class ChurnbasedRoutingTable
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class ChurnbasedRoutingTable < RoutingTable
include Routing::RandomPartitioner
attr :fname
Method release_process
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def release_process
@log.info("#{__method__}:start.")
if @rttable.can_i_release?(@stats.ap_str, @stats.rep_host)
@log.error("#{__method__}:Sufficient nodes do not found.")
- 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_random_reqs
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def send_random_reqs addr, port
rc = Roma::Client::RomaClient.new([ "#{addr}_#{port.to_s}" ])
n=1000
while @runnable
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"