lib/roma/command/command_definition.rb

Summary

Maintainability
F
6 days
Test Coverage

File command_definition.rb has 391 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Roma
  module Command
    module Definition

      class ClientErrorException < Exception; end
Severity: Minor
Found in lib/roma/command/command_definition.rb - About 5 hrs to fix

    Method def_write_command_with_key has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

            def def_write_command_with_key(cmd, forward = :one_line, &block)
              define_method "ev_#{cmd}" do |s|
                return send_data("CLIENT_ERROR does not find key\r\n") if s.length < 2
                begin
                  params = CommandParams.new
    Severity: Minor
    Found in lib/roma/command/command_definition.rb - About 5 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method def_write_command_with_key_value has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

            def def_write_command_with_key_value(cmd, idx_of_val_len, forward = :one_line, &block)
              define_method "ev_#{cmd}" do |s|
                return send_data("CLIENT_ERROR does not find key\r\n") if s.length < 2
                begin
                  params = CommandParams.new
    Severity: Minor
    Found in lib/roma/command/command_definition.rb - About 5 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method def_write_command_with_key_value has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            def def_write_command_with_key_value(cmd, idx_of_val_len, forward = :one_line, &block)
              define_method "ev_#{cmd}" do |s|
                return send_data("CLIENT_ERROR does not find key\r\n") if s.length < 2
                begin
                  params = CommandParams.new
    Severity: Major
    Found in lib/roma/command/command_definition.rb - About 2 hrs to fix

      Method def_write_command_with_key has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              def def_write_command_with_key(cmd, forward = :one_line, &block)
                define_method "ev_#{cmd}" do |s|
                  return send_data("CLIENT_ERROR does not find key\r\n") if s.length < 2
                  begin
                    params = CommandParams.new
      Severity: Major
      Found in lib/roma/command/command_definition.rb - About 2 hrs to fix

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

                def def_command_with_key_value(cmd, idx_of_val_len, forward = :one_line, &block)
                  define_method "ev_#{cmd}" do |s|
                    return send_data("CLIENT_ERROR does not find key\r\n") if s.length < 2
                    begin
                      params = CommandParams.new
        Severity: Minor
        Found in lib/roma/command/command_definition.rb - About 2 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

                def def_command_with_key(cmd, forward = :one_line, &block)
                  define_method "ev_#{cmd}" do |s|
                    return send_data("CLIENT_ERROR does not find key\r\n") if s.length < 2
                    begin
                      params = CommandParams.new
        Severity: Minor
        Found in lib/roma/command/command_definition.rb - About 2 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

                def def_read_command_with_key(cmd, forward = :one_line, &block)
                  define_method "ev_#{cmd}" do |s|
                    return send_data("CLIENT_ERROR does not find key\r\n") if s.length < 2
                    begin
                      params = CommandParams.new
        Severity: Minor
        Found in lib/roma/command/command_definition.rb - About 2 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

                def def_read_command_with_key_value(cmd, idx_of_val_len, forward = :one_line, &block)
                  define_method "ev_#{cmd}" do |s|
                    return send_data("CLIENT_ERROR does not find key\r\n") if s.length < 2
                    begin
                      params = CommandParams.new
        Severity: Minor
        Found in lib/roma/command/command_definition.rb - About 2 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method forward_and_multi_line_receive has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def forward_and_multi_line_receive(nid, rs, data=nil)
                if rs.last == "forward"
                  return send_data("SERVER_ERROR Routing table is inconsistent.\r\n")
                end
        
        
        Severity: Minor
        Found in lib/roma/command/command_definition.rb - About 1 hr to fix

          Method forward_and_multi_line_receive has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

                def forward_and_multi_line_receive(nid, rs, data=nil)
                  if rs.last == "forward"
                    return send_data("SERVER_ERROR Routing table is inconsistent.\r\n")
                  end
          
          
          Severity: Minor
          Found in lib/roma/command/command_definition.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 def_read_command_with_key_value has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def def_read_command_with_key_value(cmd, idx_of_val_len, forward = :one_line, &block)
                    define_method "ev_#{cmd}" do |s|
                      return send_data("CLIENT_ERROR does not find key\r\n") if s.length < 2
                      begin
                        params = CommandParams.new
          Severity: Minor
          Found in lib/roma/command/command_definition.rb - About 1 hr to fix

            Method def_command_with_key_value has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    def def_command_with_key_value(cmd, idx_of_val_len, forward = :one_line, &block)
                      define_method "ev_#{cmd}" do |s|
                        return send_data("CLIENT_ERROR does not find key\r\n") if s.length < 2
                        begin
                          params = CommandParams.new
            Severity: Minor
            Found in lib/roma/command/command_definition.rb - About 1 hr to fix

              Method def_read_command_with_key has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      def def_read_command_with_key(cmd, forward = :one_line, &block)
                        define_method "ev_#{cmd}" do |s|
                          return send_data("CLIENT_ERROR does not find key\r\n") if s.length < 2
                          begin
                            params = CommandParams.new
              Severity: Minor
              Found in lib/roma/command/command_definition.rb - About 1 hr to fix

                Method def_command_with_key has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        def def_command_with_key(cmd, forward = :one_line, &block)
                          define_method "ev_#{cmd}" do |s|
                            return send_data("CLIENT_ERROR does not find key\r\n") if s.length < 2
                            begin
                              params = CommandParams.new
                Severity: Minor
                Found in lib/roma/command/command_definition.rb - About 1 hr to fix

                  Method def_command_with_relay has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def def_command_with_relay(cmd, &block)
                            # check a duplicated command definition in a same scope
                            if public_method_defined? "ev_#{cmd}".to_sym
                              raise "ev_#{cmd} already defined."
                            end
                  Severity: Minor
                  Found in lib/roma/command/command_definition.rb - About 1 hr to fix

                    Avoid too many return statements within this method.
                    Open

                                return send_data(buf)
                    Severity: Major
                    Found in lib/roma/command/command_definition.rb - About 30 mins to fix

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

                                    if ret.instance_of? Array
                                      flg, expt, value, count, msg = ret
                                      ret = @storages[ctx.params.hash_name].set(ctx.params.vn, 
                                                                                ctx.params.key,
                                                                                ctx.params.digest,
                      Severity: Major
                      Found in lib/roma/command/command_definition.rb and 1 other location - About 2 hrs to fix
                      lib/roma/command/command_definition.rb on lines 130..154

                      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 104.

                      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 ret.instance_of? Array
                                      flg, expt, value, count, msg = ret
                                      ret = @storages[ctx.params.hash_name].set(ctx.params.vn, 
                                                                                ctx.params.key,
                                                                                ctx.params.digest,
                      Severity: Major
                      Found in lib/roma/command/command_definition.rb and 1 other location - About 2 hrs to fix
                      lib/roma/command/command_definition.rb on lines 243..267

                      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 104.

                      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 buf == nil
                                @rttable.proc_failed(nid)
                                @log.error("forward get failed:nid=#{nid} rs=#{rs} #{$@}")
                                return send_data("SERVER_ERROR Message forward failed.\r\n")
                              elsif buf.start_with?("ERROR")
                      Severity: Major
                      Found in lib/roma/command/command_definition.rb and 1 other location - About 1 hr to fix
                      lib/roma/plugin/plugin_alist.rb on lines 1412..1425

                      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 62.

                      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

                              begin
                                res << buf
                                s = buf.split(/ /)
                                if s[0] != 'VALUE'
                                  return_connection(nid, con)
                      Severity: Minor
                      Found in lib/roma/command/command_definition.rb and 1 other location - About 45 mins to fix
                      lib/roma/plugin/plugin_alist.rb on lines 1428..1437

                      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 40.

                      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 3 locations. Consider refactoring.
                      Open

                                    if params.nodes[0] != @nid
                                      if forward == :one_line
                                        return forward_and_one_line_receive(params.nodes[0], s, params.value)
                                      elsif  forward == :multi_line
                                        return forward_and_multi_line_receive(params.nodes[0], s, params.value)
                      Severity: Minor
                      Found in lib/roma/command/command_definition.rb and 2 other locations - About 30 mins to fix
                      lib/roma/command/command_definition.rb on lines 218..223
                      lib/roma/command/command_definition.rb on lines 335..340

                      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 3 locations. Consider refactoring.
                      Open

                                    if params.nodes[0] != @nid
                                      if forward == :one_line
                                        return forward_and_one_line_receive(params.nodes[0], s, params.value)
                                      elsif  forward == :multi_line
                                        return forward_and_multi_line_receive(params.nodes[0], s, params.value)
                      Severity: Minor
                      Found in lib/roma/command/command_definition.rb and 2 other locations - About 30 mins to fix
                      lib/roma/command/command_definition.rb on lines 218..223
                      lib/roma/command/command_definition.rb on lines 293..298

                      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 3 locations. Consider refactoring.
                      Open

                                    if params.nodes[0] != @nid
                                      if forward == :one_line
                                        return forward_and_one_line_receive(params.nodes[0], s, params.value)
                                      elsif  forward == :multi_line
                                        return forward_and_multi_line_receive(params.nodes[0], s, params.value)
                      Severity: Minor
                      Found in lib/roma/command/command_definition.rb and 2 other locations - About 30 mins to fix
                      lib/roma/command/command_definition.rb on lines 293..298
                      lib/roma/command/command_definition.rb on lines 335..340

                      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 3 locations. Consider refactoring.
                      Open

                                    if params.nodes[0] != @nid
                                      if forward == :one_line
                                        return forward_and_one_line_receive(params.nodes[0], s)
                                      elsif  forward == :multi_line
                                        return forward_and_multi_line_receive(params.nodes[0], s)
                      Severity: Minor
                      Found in lib/roma/command/command_definition.rb and 2 other locations - About 25 mins to fix
                      lib/roma/command/command_definition.rb on lines 68..73
                      lib/roma/command/command_definition.rb on lines 107..112

                      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 3 locations. Consider refactoring.
                      Open

                                    if params.nodes[0] != @nid
                                      if forward == :one_line
                                        return forward_and_one_line_receive(params.nodes[0], s)
                                      elsif  forward == :multi_line
                                        return forward_and_multi_line_receive(params.nodes[0], s)
                      Severity: Minor
                      Found in lib/roma/command/command_definition.rb and 2 other locations - About 25 mins to fix
                      lib/roma/command/command_definition.rb on lines 68..73
                      lib/roma/command/command_definition.rb on lines 178..183

                      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 3 locations. Consider refactoring.
                      Open

                                    if params.nodes[0] != @nid
                                      if forward == :one_line
                                        return forward_and_one_line_receive(params.nodes[0], s)
                                      elsif  forward == :multi_line
                                        return forward_and_multi_line_receive(params.nodes[0], s)
                      Severity: Minor
                      Found in lib/roma/command/command_definition.rb and 2 other locations - About 25 mins to fix
                      lib/roma/command/command_definition.rb on lines 107..112
                      lib/roma/command/command_definition.rb on lines 178..183

                      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 stored && @stats.wb_command_map.key?("#{cmd}__prev".to_sym)
                                      Roma::WriteBehindProcess::push(params.hash_name,
                                                                     @stats.wb_command_map["#{cmd}__prev".to_sym],
                                                                     params.key, stored.value)
                                    end
                      Severity: Minor
                      Found in lib/roma/command/command_definition.rb and 1 other location - About 20 mins to fix
                      lib/roma/command/command_definition.rb on lines 234..238

                      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

                                    if stored && @stats.wb_command_map.key?("#{cmd}__prev".to_sym)
                                      Roma::WriteBehindProcess::push(params.hash_name,
                                                                     @stats.wb_command_map["#{cmd}__prev".to_sym],
                                                                     params.key, stored.value)
                                    end
                      Severity: Minor
                      Found in lib/roma/command/command_definition.rb and 1 other location - About 20 mins to fix
                      lib/roma/command/command_definition.rb on lines 122..126

                      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

                            rescue => e
                              @rttable.proc_failed(nid) if e.message != "no connection"
                              @log.error("forward get failed:nid=#{nid} rs=#{rs} #{e} #{$@}")
                              send_data("SERVER_ERROR Message forward failed.\r\n")
                            end
                      Severity: Minor
                      Found in lib/roma/command/command_definition.rb and 1 other location - About 20 mins to fix
                      lib/roma/plugin/plugin_alist.rb on lines 1445..1449

                      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

                      There are no issues that match your filters.

                      Category
                      Status