lib/roma/command/sys_command_receiver.rb

Summary

Maintainability
F
1 wk
Test Coverage

File sys_command_receiver.rb has 1149 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'roma/async_process'

module Roma
  module Command

Severity: Major
Found in lib/roma/command/sys_command_receiver.rb - About 2 days to fix

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

          def ev_set_latency_avg_calc_rule(s)
            #check argument
            if /^on$|^off$/ !~ s[1]
              return send_data("CLIENT_ERROR argument 1: please input \"on\" or \"off\"\r\n")
            elsif s[1] == "on" && (s.length <= 3 || s[2].to_i < 1)
    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 ev_rset_latency_avg_calc_rule has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

          def ev_rset_latency_avg_calc_rule(s)
            if /^on$|^off$/ !~ s[1]
              return send_data("CLIENT_ERROR argument 1: please input \"on\" or \"off\"\r\n")
            elsif s[1] == "on" && (s.length <= 3 || s[2].to_i < 1)
              return send_data("CLIENT_ERROR number of arguments (0 for 3) and <count> must be greater than zero\r\n")
    Severity: Minor
    Found in lib/roma/command/sys_command_receiver.rb - About 1 hr 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 dcnice has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def dcnice(p)
            case(p)
            when 1 # highest priority
              @stats.stream_copy_wait_param = 0.001
              @storages.each_value{|st|
    Severity: Minor
    Found in lib/roma/command/sys_command_receiver.rb - About 1 hr to fix

      Method ev_set_storage_status has 36 lines of code (exceeds 25 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
      
      
      Severity: Minor
      Found in lib/roma/command/sys_command_receiver.rb - About 1 hr to fix

        Method ev_add_latency_avg_calc_cmd has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

              def ev_add_latency_avg_calc_cmd(s)
                #check argument
                if s.length < 2
                  return send_data("CLIENT_ERROR number of arguments (0 for 2)\r\n")
                end
        Severity: Minor
        Found in lib/roma/command/sys_command_receiver.rb - About 1 hr 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 34 lines of code (exceeds 25 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 1 hr to fix

          Method ev_set_latency_avg_calc_rule has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def ev_set_latency_avg_calc_rule(s)
                  #check argument
                  if /^on$|^off$/ !~ s[1]
                    return send_data("CLIENT_ERROR argument 1: please input \"on\" or \"off\"\r\n")
                  elsif s[1] == "on" && (s.length <= 3 || s[2].to_i < 1)
          Severity: Minor
          Found in lib/roma/command/sys_command_receiver.rb - About 1 hr to fix

            Method ev_rswitch_replication has 32 lines of code (exceeds 25 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)$/
            Severity: Minor
            Found in lib/roma/command/sys_command_receiver.rb - About 1 hr to fix

              Method ev_rset_latency_avg_calc_rule has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def ev_rset_latency_avg_calc_rule(s)
                      if /^on$|^off$/ !~ s[1]
                        return send_data("CLIENT_ERROR argument 1: please input \"on\" or \"off\"\r\n")
                      elsif s[1] == "on" && (s.length <= 3 || s[2].to_i < 1)
                        return send_data("CLIENT_ERROR number of arguments (0 for 3) and <count> must be greater than zero\r\n")
              Severity: Minor
              Found in lib/roma/command/sys_command_receiver.rb - About 1 hr to fix

                Method ev_radd_latency_avg_calc_cmd has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                      def ev_radd_latency_avg_calc_cmd(s)
                        if s.length < 2
                          return send_data("CLIENT_ERROR number of arguments (0 for 2)\r\n")
                        end
                        s.each_index {|idx|
                Severity: Minor
                Found in lib/roma/command/sys_command_receiver.rb - About 1 hr 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_del_latency_avg_calc_cmd has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                      def ev_del_latency_avg_calc_cmd(s)
                        #check argument
                        if s.length < 2
                          return send_data("CLIENT_ERROR number of arguments (0 for 2)\r\n")
                        end
                Severity: Minor
                Found in lib/roma/command/sys_command_receiver.rb - About 1 hr 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_rzset has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                      def ev_rzset(s)
                        key,hname = s[1].split("\e")
                        hname ||= @defhash
                        d = s[2].to_i
                        d = Digest::SHA1.hexdigest(key).hex % @rttable.hbits if d == 0
                Severity: Minor
                Found in lib/roma/command/sys_command_receiver.rb - About 1 hr 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 send_stat_result has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                      def send_stat_result(prefix,h,regexp = nil)
                        h.each{|k,v|
                          if prefix
                            key = "#{prefix}#{k}"
                          else
                Severity: Minor
                Found in lib/roma/command/sys_command_receiver.rb - About 55 mins 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_rdel_latency_avg_calc_cmd has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                      def ev_rdel_latency_avg_calc_cmd(s)
                        if s.length < 2
                          return send_data("CLIENT_ERROR number of arguments (0 for 2)\r\n")
                        end
                
                
                Severity: Minor
                Found in lib/roma/command/sys_command_receiver.rb - About 45 mins 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_wb_command_map has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                      def ev_wb_command_map(s)
                        if s.length < 2
                          return send_data("CLIENT_ERROR number of arguments\r\n")
                        end
                        map = {}
                Severity: Minor
                Found in lib/roma/command/sys_command_receiver.rb - About 35 mins 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_rwb_command_map has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                      def ev_rwb_command_map(s)
                        if s.length < 2
                          return send_data("CLIENT_ERROR number of arguments\r\n")
                        end
                        map = {}
                Severity: Minor
                Found in lib/roma/command/sys_command_receiver.rb - About 35 mins 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

                Avoid too many return statements within this method.
                Open

                            return send_data("CLIENT_ERROR storage[#{dn}] status can't changed\r\n")
                Severity: Major
                Found in lib/roma/command/sys_command_receiver.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                            return send_data("CLIENT_ERROR status parse error\r\n")
                  Severity: Major
                  Found in lib/roma/command/sys_command_receiver.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return send_data("CLIENT_ERROR storage[#{dn}] status can't changed\r\n")
                    Severity: Major
                    Found in lib/roma/command/sys_command_receiver.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return send_data("CLIENT_ERROR storage[#{dn}] != :safecopy_flushed status\r\n")
                      Severity: Major
                      Found in lib/roma/command/sys_command_receiver.rb - About 30 mins to fix

                        Method ev_set_log_shift_age has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def ev_set_log_shift_age(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\r\n")
                                elsif s[1].to_i < 1 && !['0', 'min', 'hour', 'daily', 'weekly', 'monthly'].include?(s[1])
                                  return send_data("CLIENT_ERROR invalid arguments\r\n")
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb - About 25 mins 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_rset_log_shift_age has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def ev_rset_log_shift_age(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\r\n")
                                elsif s[1].to_i < 1 && !['0', 'min', 'hour', 'daily', 'weekly', 'monthly'].include?(s[1])
                                  return send_data("CLIENT_ERROR invalid arguments\r\n")
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb - About 25 mins 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_rset has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def ev_rset(s)
                                key,hname = s[1].split("\e")
                                hname ||= @defhash
                                d = s[2].to_i
                                d = Digest::SHA1.hexdigest(key).hex % @rttable.hbits if d == 0
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb - About 25 mins 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

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                s.each_index {|idx|
                                  if idx >= 1 && (!Event::Handler::ev_list.include?(s[idx]) || Event::Handler::system_commands.include?(s[idx]))
                                     return send_data("NOT SUPPORT [#{s[idx]}] command\r\n")
                                  end
                                  if idx >= 1 && @stats.latency_check_cmd.include?(s[idx])
                        Severity: Major
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 1 hr to fix
                        lib/roma/command/sys_command_receiver.rb on lines 630..636

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 53.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                s.each_index {|idx|
                                  if idx >= 2 && (!Event::Handler::ev_list.include?(s[idx]) || Event::Handler::system_commands.include?(s[idx]))
                                     return send_data("NOT SUPPORT [#{s[idx]}] command\r\n")
                                  end
                                  if idx >= 1 && @stats.latency_check_cmd.include?(s[idx])
                        Severity: Major
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 1 hr to fix
                        lib/roma/command/sys_command_receiver.rb on lines 604..610

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 53.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                if @storages[hname].rset(vn, key, d, s[3].to_i, s[4].to_i, data)
                                  send_data("STORED\r\n")
                                else
                                  @log.error("rset NOT_STORED:#{@storages[hname].error_message} #{vn} #{s[1]} #{d} #{s[3]} #{s[4]}")
                                  send_data("NOT_STORED\r\n")
                        Severity: Major
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 1 hr to fix
                        lib/roma/command/sys_command_receiver.rb on lines 431..435

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 51.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                if @storages[hname].rset(vn, key, d, s[3].to_i, s[4].to_i, data)
                                  send_data("STORED\r\n")
                                else
                                  @log.error("rzset NOT_STORED:#{@storages[hname].error_message} #{vn} #{s[1]} #{d} #{s[3]} #{s[4]}")
                                  send_data("NOT_STORED\r\n")
                        Severity: Major
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 1 hr to fix
                        lib/roma/command/sys_command_receiver.rb on lines 405..409

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 51.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                              def ev_set_emconnection_pool_maxlength(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\r\n")
                                end
                                if s[1].to_i < 1
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 55 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 760..771

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 46.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                              def ev_set_connection_pool_maxlength(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\r\n")
                                end
                                if s[1].to_i < 1
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 55 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 789..800

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 46.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                              def ev_shutdown(s)
                                send_data("*** ARE YOU REALLY SURE TO SHUTDOWN? *** (yes/no)\r\n")
                                if gets != "yes\r\n"
                                  close_connection_after_writing
                                  return
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 55 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 9..26

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 46.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                              def ev_balse(s)
                                send_data("Are you sure?(yes/no)\r\n")
                                if gets != "yes\r\n"
                                  close_connection_after_writing
                                  return
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 55 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 43..60

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 46.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                if /^on$|^off$/ !~ s[1]
                                  return send_data("CLIENT_ERROR argument 1: please input \"on\" or \"off\"\r\n")
                                elsif s[1] == "on" && (s.length <= 3 || s[2].to_i < 1)
                                  return send_data("CLIENT_ERROR number of arguments (0 for 3) and <count> must be greater than zero\r\n")
                                elsif s[1] == "off" && !(s.length == 2)
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 55 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 565..571

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 45.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                if /^on$|^off$/ !~ s[1]
                                  return send_data("CLIENT_ERROR argument 1: please input \"on\" or \"off\"\r\n")
                                elsif s[1] == "on" && (s.length <= 3 || s[2].to_i < 1)
                                  return send_data("CLIENT_ERROR number of arguments (0 for 3) and <count> must be greater than zero\r\n")
                                elsif s[1] == "off" && !(s.length == 2)
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 55 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 525..531

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 45.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                              def ev_set_reqpushv_timeout_count(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\n\r")
                                end
                                if s[1].to_i <= 0
                        Severity: Major
                        Found in lib/roma/command/sys_command_receiver.rb and 5 other locations - About 55 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 928..939
                        lib/roma/command/sys_command_receiver.rb on lines 955..966
                        lib/roma/command/sys_command_receiver.rb on lines 983..993
                        lib/roma/command/sys_command_receiver.rb on lines 1035..1045
                        lib/roma/command/sys_command_receiver.rb on lines 1061..1071

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 44.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                              def ev_set_hilatency_warn_time(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\r\n")
                                end
                                if s[1].to_f <= 0
                        Severity: Major
                        Found in lib/roma/command/sys_command_receiver.rb and 5 other locations - About 55 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 955..966
                        lib/roma/command/sys_command_receiver.rb on lines 983..993
                        lib/roma/command/sys_command_receiver.rb on lines 1009..1019
                        lib/roma/command/sys_command_receiver.rb on lines 1035..1045
                        lib/roma/command/sys_command_receiver.rb on lines 1061..1071

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 44.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                              def ev_set_spushv_read_timeout(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\n\r")
                                end
                                if s[1].to_i <= 0
                        Severity: Major
                        Found in lib/roma/command/sys_command_receiver.rb and 5 other locations - About 55 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 928..939
                        lib/roma/command/sys_command_receiver.rb on lines 955..966
                        lib/roma/command/sys_command_receiver.rb on lines 1009..1019
                        lib/roma/command/sys_command_receiver.rb on lines 1035..1045
                        lib/roma/command/sys_command_receiver.rb on lines 1061..1071

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 44.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                              def ev_set_spushv_klength_warn(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\n\r")
                                end
                                if s[1].to_i <= 0
                        Severity: Major
                        Found in lib/roma/command/sys_command_receiver.rb and 5 other locations - About 55 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 928..939
                        lib/roma/command/sys_command_receiver.rb on lines 955..966
                        lib/roma/command/sys_command_receiver.rb on lines 983..993
                        lib/roma/command/sys_command_receiver.rb on lines 1009..1019
                        lib/roma/command/sys_command_receiver.rb on lines 1061..1071

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 44.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                              def ev_set_spushv_vlength_warn(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\n\r")
                                end
                                if s[1].to_i <= 0
                        Severity: Major
                        Found in lib/roma/command/sys_command_receiver.rb and 5 other locations - About 55 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 928..939
                        lib/roma/command/sys_command_receiver.rb on lines 955..966
                        lib/roma/command/sys_command_receiver.rb on lines 983..993
                        lib/roma/command/sys_command_receiver.rb on lines 1009..1019
                        lib/roma/command/sys_command_receiver.rb on lines 1035..1045

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 44.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                              def ev_set_routing_trans_timeout(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\n\r")
                                end
                                if s[1].to_f <= 0
                        Severity: Major
                        Found in lib/roma/command/sys_command_receiver.rb and 5 other locations - About 55 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 928..939
                        lib/roma/command/sys_command_receiver.rb on lines 983..993
                        lib/roma/command/sys_command_receiver.rb on lines 1009..1019
                        lib/roma/command/sys_command_receiver.rb on lines 1035..1045
                        lib/roma/command/sys_command_receiver.rb on lines 1061..1071

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 44.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                  if st.dbs[dn] != :normal
                                    return send_data("CLIENT_ERROR storage[#{dn}] != :normal status\r\n")
                                  end
                                  if st.set_db_stat(dn, :safecopy_flushing) == false
                                    return send_data("CLIENT_ERROR storage[#{dn}] status can't changed\r\n")
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 40 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 1181..1187

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 38.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                  if st.dbs[dn] != :safecopy_flushed
                                    return send_data("CLIENT_ERROR storage[#{dn}] != :safecopy_flushed status\r\n")
                                  end
                                  if st.set_db_stat(dn, :cachecleaning) == false
                                    return send_data("CLIENT_ERROR storage[#{dn}] status can't changed\r\n")
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 40 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 1173..1179

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 38.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                if s[1].to_i > 0 || s[1] == '0'
                                  @log.set_log_shift_age(s[1].to_i)
                                  @stats.log_shift_age = s[1].to_i
                                else
                                  @log.set_log_shift_age(s[1])
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 40 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 1294..1300

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 37.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                if s[1].to_i > 0 || s[1] == '0'
                                  @log.set_log_shift_age(s[1].to_i)
                                  @stats.log_shift_age = s[1].to_i
                                else
                                  @log.set_log_shift_age(s[1])
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 40 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 1312..1318

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 37.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                s.each_index {|idx|
                                  if idx >= 3 && (!Event::Handler::ev_list.include?(s[idx]) || Event::Handler::system_commands.include?(s[idx]))
                                     return send_data("NOT SUPPORT [#{s[idx]}] command\r\n")
                                  end
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 30 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 573..576

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 33.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                s.each_index {|idx|
                                  if idx >= 3 && (!Event::Handler::ev_list.include?(s[idx]) || Event::Handler::system_commands.include?(s[idx]))
                                     return send_data("NOT SUPPORT [#{s[idx]}] command\r\n")
                                  end
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 30 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 534..537

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 33.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\r\n")
                                elsif s[1].to_i < 1 && !['0', 'min', 'hour', 'daily', 'weekly', 'monthly'].include?(s[1])
                                  return send_data("CLIENT_ERROR invalid arguments\r\n")
                                end
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 25 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 1306..1310

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 31.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\r\n")
                                elsif s[1].to_i < 1 && !['0', 'min', 'hour', 'daily', 'weekly', 'monthly'].include?(s[1])
                                  return send_data("CLIENT_ERROR invalid arguments\r\n")
                                end
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 25 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 1286..1290

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 31.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                  $1.split(',').each do |kv|
                                    k, v = kv.split('=>')
                                    map[k[1..-1].to_sym] = v.to_i if v && k[0]==':'
                                  end
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 25 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 1096..1099

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 31.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                  $1.split(',').each do |kv|
                                    k, v = kv.split('=>')
                                    map[k[1..-1].to_sym] = v.to_i if v && k[0]==':'
                                  end
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 25 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 1117..1120

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 31.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                              def ev_rset_emconnection_pool_maxlength(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\r\n")
                                end
                                if s[1].to_i < 1
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 25 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 775..784

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 30.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                              def ev_rset_connection_pool_maxlength(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\r\n")
                                end
                                if s[1].to_i < 1
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 25 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 804..813

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 30.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                if s[1] != "nil"
                                  @stats.latency_check_time_count = s[1].to_i
                                  @stats.latency_log = true
                                elsif s[1] == "nil"
                                  @stats.latency_check_time_count = false
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 25 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 721..727

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 29.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                if s[1] != "nil"
                                  @stats.latency_check_time_count = s[1].to_i
                                  @stats.latency_log = true
                                elsif s[1] == "nil"
                                  @stats.latency_check_time_count = false
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 25 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 703..709

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 29.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                              def ev_rset_spushv_vlength_warn(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\n\r")
                                end
                                if s[1].to_i <= 0
                        Severity: Major
                        Found in lib/roma/command/sys_command_receiver.rb and 5 other locations - About 20 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 943..951
                        lib/roma/command/sys_command_receiver.rb on lines 970..979
                        lib/roma/command/sys_command_receiver.rb on lines 997..1005
                        lib/roma/command/sys_command_receiver.rb on lines 1023..1031
                        lib/roma/command/sys_command_receiver.rb on lines 1049..1057

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 28.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                              def ev_rset_routing_trans_timeout(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\n\r")
                                end
                                if s[1].to_f <= 0
                        Severity: Major
                        Found in lib/roma/command/sys_command_receiver.rb and 5 other locations - About 20 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 943..951
                        lib/roma/command/sys_command_receiver.rb on lines 997..1005
                        lib/roma/command/sys_command_receiver.rb on lines 1023..1031
                        lib/roma/command/sys_command_receiver.rb on lines 1049..1057
                        lib/roma/command/sys_command_receiver.rb on lines 1075..1083

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 28.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                              def ev_rset_spushv_read_timeout(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\n\r")
                                end
                                if s[1].to_i <= 0
                        Severity: Major
                        Found in lib/roma/command/sys_command_receiver.rb and 5 other locations - About 20 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 943..951
                        lib/roma/command/sys_command_receiver.rb on lines 970..979
                        lib/roma/command/sys_command_receiver.rb on lines 1023..1031
                        lib/roma/command/sys_command_receiver.rb on lines 1049..1057
                        lib/roma/command/sys_command_receiver.rb on lines 1075..1083

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 28.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                              def ev_rset_spushv_klength_warn(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\n\r")
                                end
                                if s[1].to_i <= 0
                        Severity: Major
                        Found in lib/roma/command/sys_command_receiver.rb and 5 other locations - About 20 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 943..951
                        lib/roma/command/sys_command_receiver.rb on lines 970..979
                        lib/roma/command/sys_command_receiver.rb on lines 997..1005
                        lib/roma/command/sys_command_receiver.rb on lines 1023..1031
                        lib/roma/command/sys_command_receiver.rb on lines 1075..1083

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 28.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                              def ev_rset_reqpushv_timeout_count(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\n\r")
                                end
                                if s[1].to_i <= 0
                        Severity: Major
                        Found in lib/roma/command/sys_command_receiver.rb and 5 other locations - About 20 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 943..951
                        lib/roma/command/sys_command_receiver.rb on lines 970..979
                        lib/roma/command/sys_command_receiver.rb on lines 997..1005
                        lib/roma/command/sys_command_receiver.rb on lines 1049..1057
                        lib/roma/command/sys_command_receiver.rb on lines 1075..1083

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 28.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 6 locations. Consider refactoring.
                        Open

                              def ev_rset_hilatency_warn_time(s)
                                if s.length != 2
                                  return send_data("CLIENT_ERROR number of arguments\r\n")
                                end
                                if s[1].to_f <= 0
                        Severity: Major
                        Found in lib/roma/command/sys_command_receiver.rb and 5 other locations - About 20 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 970..979
                        lib/roma/command/sys_command_receiver.rb on lines 997..1005
                        lib/roma/command/sys_command_receiver.rb on lines 1023..1031
                        lib/roma/command/sys_command_receiver.rb on lines 1049..1057
                        lib/roma/command/sys_command_receiver.rb on lines 1075..1083

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 28.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                s.each_index {|idx|
                                  @stats.latency_check_cmd.delete(s[idx]) if idx >= 1
                                  @stats.latency_data.delete(s[idx]) if idx >= 1
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 15 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 665..667

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 25.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Identical blocks of code found in 2 locations. Consider refactoring.
                        Open

                                s.each_index {|idx|
                                  @stats.latency_check_cmd.delete(s[idx]) if idx >= 1
                                  @stats.latency_data.delete(s[idx]) if idx >= 1
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 15 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 684..686

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 25.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                              def ev_rbalse(s)
                                if s.length == 2
                                  @log.info("Receive a rbalse #{s[1]}")
                                else
                                  @log.info("Receive a rbalse command.")
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 15 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 64..73

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 25.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                              def ev_rshutdown(s)
                                if s.length == 2
                                  @log.info("Receive a rshutdown #{s[1]}")
                                else
                                  @log.info("Receive a rshutdown command.")
                        Severity: Minor
                        Found in lib/roma/command/sys_command_receiver.rb and 1 other location - About 15 mins to fix
                        lib/roma/command/sys_command_receiver.rb on lines 30..39

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 25.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        There are no issues that match your filters.

                        Category
                        Status