Showing 333 of 491 total issues

Method def_read_command_with_key has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

        def def_read_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
Severity: Minor
Found in lib/roma/command/command_definition.rb - About 2 hrs to fix

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 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

        def def_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
Severity: Minor
Found in lib/roma/command/command_definition.rb - About 2 hrs to fix

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_gets has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

      def ev_gets(s)
        nk = {} # {node-id1=>[key1,key2,..],node-id2=>[key3,key4,..]}
        kvn = {} # {key1=>vn1, key2=>vn2, ... }
        s[1..-1].each{|kh|
          key, = kh.split("\e") # split a hash-name
Severity: Minor
Found in lib/roma/plugin/plugin_storage.rb - About 2 hrs to fix

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_read_command_with_key_value has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

        def def_read_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
Severity: Minor
Found in lib/roma/command/command_definition.rb - About 2 hrs to fix

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_delete has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

      def ev_alist_delete(s)
        hname, k, d, vn, nodes = calc_hash(s[1])
        data = read_bytes(s[2].to_i)
        read_bytes(2)
        return forward2(nodes[0], s, data) if nodes[0] != @nid
Severity: Minor
Found in lib/roma/plugin/plugin_alist.rb - About 2 hrs to fix

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_switch_replication has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

      def ev_switch_replication(s)
        unless s.length.between?(2, 4)
          return send_data("CLIENT_ERROR number of arguments\r\n")
        end
        unless s[1] =~ /^(true|false)$/
Severity: Minor
Found in lib/roma/command/sys_command_receiver.rb - About 2 hrs to fix

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 join_process has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def join_process
      @log.info("#{__method__}:start")
      count = 0
      nv = @rttable.v_idx.length
      exclude_nodes = @rttable.exclude_nodes_for_join(@stats.ap_str, @stats.rep_host)
Severity: Minor
Found in lib/roma/async_process.rb - About 2 hrs to fix

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 random_request_sender has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def random_request_sender(ini_nodes)
  rc=Roma::Client::RomaClient.new(ini_nodes)

  n=10000
  loop{
Severity: Minor
Found in lib/roma/tools/simple_bench2.rb - About 2 hrs to fix

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_sync_routing_process has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def start_sync_routing_process
      return if @stats.run_join || @stats.run_recover || @stats.run_balance || @stats.run_sync_routing

      nodes = @rttable.nodes
      return if nodes.length == 1 && nodes[0] == @stats.ap_str
Severity: Minor
Found in lib/roma/romad.rb - About 2 hrs to fix

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 random_rquest_sender has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def random_rquest_sender(ini_nodes, n)
  puts __method__
  rc=Roma::Client::RomaClient.new(ini_nodes)

  loop do
Severity: Minor
Found in lib/roma/tools/safecopy_integration_test.rb - About 2 hrs to fix

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 random_rquest_sender has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def random_rquest_sender(ini_nodes, n)
  puts __method__
  rc=Roma::Client::RomaClient.new(ini_nodes)

  loop do
Severity: Minor
Found in lib/roma/tools/safecopy_test.rb - About 2 hrs to fix

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 balance_process has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def balance_process
      @log.info("#{__method__}:start")
      count = 0
      nv = @rttable.v_idx.length
      exclude_nodes = @rttable.exclude_nodes_for_balance(@stats.ap_str, @stats.rep_host)
Severity: Minor
Found in lib/roma/async_process.rb - About 2 hrs to fix

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 random_request_sender has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def random_request_sender(ini_nodes, n)
  puts __method__
  rc=Roma::Client::RomaClient.new(ini_nodes)

  loop do
Severity: Minor
Found in lib/roma/tools/simple_bench.rb - About 2 hrs to fix

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 mkconfig has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def mkconfig(mode)
      skip = skip_menu!(mode)

      while true
        clear_screen
Severity: Minor
Found in lib/roma/tools/mkconfig.rb - About 2 hrs to fix

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 test_change_status has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def test_change_status

  puts "write (0...10000) = 0"
  set_counts(ARGV, 0...10000, "default_key",0)
  Thread.new { random_rquest_sender(ARGV, 10000) }
Severity: Major
Found in lib/roma/tools/safecopy_integration_test.rb - About 2 hrs to fix

    File test-scenario.rb has 257 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'date'
    require 'logger'
    require 'roma/client/rclient'
    require 'roma/tools/multi_commander'
    require 'optparse'
    Severity: Minor
    Found in lib/roma/tools/test-scenario.rb - About 2 hrs to fix

      Class Tribunus has 21 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class Tribunus
        #protocol
        #
        #update:<reply_ocunt>: <romad_hostname> [<romad_port> ...]
      
      
      Severity: Minor
      Found in lib/roma/tools/tribunus.rb - About 2 hrs to fix

        Class DummyStorage has 21 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class DummyStorage
        
              def initialize; end
              def init(*args); end
              def opendb(fname,divnum); end
        Severity: Minor
        Found in lib/roma/storage/dummy_storage.rb - About 2 hrs to fix

          Method save_data has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def save_data(res)
                if res.key?("storage")
                  case res["storage"].value
                  when "Ruby Hash"
                    req = "rh_storage"
          Severity: Major
          Found in lib/roma/tools/mkconfig.rb - About 2 hrs to fix

            Method dispatcher has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def dispatcher
                    @stats = Roma::Stats.instance
                    #@log.debug("Roma::Event::Handler.dipatcher called")
                    while(@connected) do
                      @enter_time = nil
            Severity: Major
            Found in lib/roma/event/handler.rb - About 2 hrs to fix
              Severity
              Category
              Status
              Source
              Language