lib/roma/plugin/plugin_alist.rb

Summary

Maintainability
F
2 wks
Test Coverage

File plugin_alist.rb has 1085 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'timeout'
require 'roma/messaging/con_pool'
require 'json'

module Roma
Severity: Major
Found in lib/roma/plugin/plugin_alist.rb - About 2 days to fix

    Method ev_alist_spushv has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

          def ev_alist_spushv(s)
            if s.length != 3
              @log.error("#{__method__}:wrong number of arguments(#{s})")
              return send_data("CLIENT_ERROR Wrong number of arguments.\r\n")
            end
    Severity: Minor
    Found in lib/roma/plugin/plugin_alist.rb - About 3 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Method ev_alist_to_json has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

          def ev_alist_to_json(s)
            hname, k, d, vn, nodes = calc_hash(s[1])
            return forward1(nodes[0], s) if nodes[0] != @nid
    
            ddata = @storages[hname].get(vn, k, 0)
    Severity: Minor
    Found in lib/roma/plugin/plugin_alist.rb - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Method ev_alist_join_with_time has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

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

    Cognitive Complexity

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

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

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

    Further reading

    Method ev_alist_gets_with_time has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

          def ev_alist_gets_with_time(s)
            hname, k, d, vn, nodes = calc_hash(s[1])
            return forward1(nodes[0], s) if nodes[0] != @nid
    
            ddata = @storages[hname].get(vn, k, 0)
    Severity: Minor
    Found in lib/roma/plugin/plugin_alist.rb - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Method ev_alist_gets has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

          def ev_alist_gets(s)
            hname, k, d, vn, nodes = calc_hash(s[1])
            return forward1(nodes[0], s) if nodes[0] != @nid
    
            ddata = @storages[hname].get(vn, k, 0)
    Severity: Minor
    Found in lib/roma/plugin/plugin_alist.rb - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Method ev_alist_join has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

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

    Cognitive Complexity

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

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

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

    Further reading

    Method ev_alist_to_s has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

          def ev_alist_to_s(s)
            hname, k, d, vn, nodes = calc_hash(s[1])
            return forward1(nodes[0], s) if nodes[0] != @nid
    
            ddata = @storages[hname].get(vn, k, 0)
    Severity: Minor
    Found in lib/roma/plugin/plugin_alist.rb - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

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

    Cognitive Complexity

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

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

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

    Further reading

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

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

    Cognitive Complexity

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

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

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

    Further reading

    Method ev_alist_expired_swap_and_insert has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

          def ev_alist_expired_swap_and_insert(s)
            hname, k, d, vn, nodes = calc_hash(s[1])
            data = read_bytes(s[3].to_i)
            read_bytes(2)
            return forward2(nodes[0], s, data) if nodes[0] != @nid
    Severity: Minor
    Found in lib/roma/plugin/plugin_alist.rb - About 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_alist_expired_swap_and_sized_insert has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

          def ev_alist_expired_swap_and_sized_insert(s)
            hname, k, d, vn, nodes = calc_hash(s[1])
            data = read_bytes(s[4].to_i)
            read_bytes(2)
            return forward2(nodes[0], s, data) if nodes[0] != @nid
    Severity: Minor
    Found in lib/roma/plugin/plugin_alist.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_alist_expired_swap_and_push has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

          def ev_alist_expired_swap_and_push(s)
            hname, k, d, vn, nodes = calc_hash(s[1])
            data = read_bytes(s[3].to_i)
            read_bytes(2)
            return forward2(nodes[0], s, data) if nodes[0] != @nid
    Severity: Minor
    Found in lib/roma/plugin/plugin_alist.rb - About 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_alist_delete_at has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

          def ev_alist_delete_at(s)
            hname, k, d, vn, nodes = calc_hash(s[1])
            return forward2(nodes[0], s) if nodes[0] != @nid
            
            ddata = @storages[hname].get(vn, k, d)
    Severity: Minor
    Found in lib/roma/plugin/plugin_alist.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_alist_update_at has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

          def ev_alist_update_at(s)
            hname, k, d, vn, nodes = calc_hash(s[1])
            data = read_bytes(s[3].to_i)
            read_bytes(2)
            return forward2(nodes[0], s, data) if nodes[0] != @nid
    Severity: Minor
    Found in lib/roma/plugin/plugin_alist.rb - About 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_alist_swap_and_sized_push has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

          def ev_alist_swap_and_sized_push(s)
            hname, k, d, vn, nodes = calc_hash(s[1])
            data = read_bytes(s[3].to_i)
            read_bytes(2)
            return forward2(nodes[0], s, data) if nodes[0] != @nid
    Severity: Minor
    Found in lib/roma/plugin/plugin_alist.rb - About 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 forward1 has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def forward1(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/plugin/plugin_alist.rb - About 1 hr to fix

      Method ev_alist_spushv has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def ev_alist_spushv(s)
              if s.length != 3
                @log.error("#{__method__}:wrong number of arguments(#{s})")
                return send_data("CLIENT_ERROR Wrong number of arguments.\r\n")
              end
      Severity: Minor
      Found in lib/roma/plugin/plugin_alist.rb - About 1 hr to fix

        Method ev_alist_swap_and_insert has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

              def ev_alist_swap_and_insert(s)
                hname, k, d, vn, nodes = calc_hash(s[1])
                data = read_bytes(s[2].to_i)
                read_bytes(2)
                return forward2(nodes[0], s, data) if nodes[0] != @nid
        Severity: Minor
        Found in lib/roma/plugin/plugin_alist.rb - About 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_alist_sized_push has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

              def ev_alist_sized_push(s)
                hname, k, d, vn, nodes = calc_hash(s[1])
                data = read_bytes(s[3].to_i)
                read_bytes(2)
                return forward2(nodes[0], s, data) if nodes[0] != @nid
        Severity: Minor
        Found in lib/roma/plugin/plugin_alist.rb - About 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_alist_swap_and_sized_insert has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

              def ev_alist_swap_and_sized_insert(s)
                hname, k, d, vn, nodes = calc_hash(s[1])
                data = read_bytes(s[3].to_i)
                read_bytes(2)
                return forward2(nodes[0], s, data) if nodes[0] != @nid
        Severity: Minor
        Found in lib/roma/plugin/plugin_alist.rb - About 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_alist_swap_and_push has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

              def ev_alist_swap_and_push(s)
                hname, k, d, vn, nodes = calc_hash(s[1])
                data = read_bytes(s[2].to_i)
                read_bytes(2)
                return forward2(nodes[0], s, data) if nodes[0] != @nid
        Severity: Minor
        Found in lib/roma/plugin/plugin_alist.rb - About 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 forward1 has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

              def forward1(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/plugin/plugin_alist.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_alist_at has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

              def ev_alist_at(s)
                hname, k, d, vn, nodes = calc_hash(s[1])
                return forward1(nodes[0], s)  if nodes[0] != @nid
        
                ddata = @storages[hname].get(vn, k, d)
        Severity: Minor
        Found in lib/roma/plugin/plugin_alist.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_alist_swap_and_sized_push has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

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

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

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

                  def ev_alist_clear(s)
                    hname, k, d, vn, nodes = calc_hash(s[1])
                    return forward2(nodes[0], s) if nodes[0] != @nid
            
                    ddata = @storages[hname].get(vn, k, d)
            Severity: Minor
            Found in lib/roma/plugin/plugin_alist.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_alist_pop has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                  def ev_alist_pop(s)
                    hname, k, d, vn, nodes = calc_hash(s[1])
                    return forward1(nodes[0], s) if nodes[0] != @nid
            
                    ddata = @storages[hname].get(vn, k, d)
            Severity: Minor
            Found in lib/roma/plugin/plugin_alist.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_alist_insert has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                  def ev_alist_insert(s)
                    hname, k, d, vn, nodes = calc_hash(s[1])
                    data = read_bytes(s[3].to_i)
                    read_bytes(2)
                    return forward2(nodes[0], s, data) if nodes[0] != @nid
            Severity: Minor
            Found in lib/roma/plugin/plugin_alist.rb - About 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_alist_shift has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                  def ev_alist_shift(s)
                    hname, k, d, vn, nodes = calc_hash(s[1])
                    return forward1(nodes[0], s) if nodes[0] != @nid
            
                    ddata = @storages[hname].get(vn, k, d)
            Severity: Minor
            Found in lib/roma/plugin/plugin_alist.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_alist_sized_insert has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                  def ev_alist_sized_insert(s)
                    hname, k, d, vn, nodes = calc_hash(s[1])
                    data = read_bytes(s[3].to_i)
                    read_bytes(2)
                    return forward2(nodes[0], s, data) if nodes[0] != @nid
            Severity: Minor
            Found in lib/roma/plugin/plugin_alist.rb - About 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_alist_push has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                  def ev_alist_push(s)
                    hname, k, d, vn, nodes = calc_hash(s[1])
                    data = read_bytes(s[2].to_i)
                    read_bytes(2)
                    if nodes[0] != @nid
            Severity: Minor
            Found in lib/roma/plugin/plugin_alist.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_alist_swap_and_sized_insert has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

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

                    def ev_alist_gets_with_time(s)
                      hname, k, d, vn, nodes = calc_hash(s[1])
                      return forward1(nodes[0], s) if nodes[0] != @nid
              
                      ddata = @storages[hname].get(vn, k, 0)
              Severity: Minor
              Found in lib/roma/plugin/plugin_alist.rb - About 1 hr to fix

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

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

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

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

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

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

                      Method ev_alist_sized_push has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Method ev_alist_join has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

                          Method ev_alist_expired_swap_and_sized_insert has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            Method ev_alist_gets has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  def ev_alist_gets(s)
                                    hname, k, d, vn, nodes = calc_hash(s[1])
                                    return forward1(nodes[0], s) if nodes[0] != @nid
                            
                                    ddata = @storages[hname].get(vn, k, 0)
                            Severity: Minor
                            Found in lib/roma/plugin/plugin_alist.rb - About 1 hr to fix

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

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

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

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

                                  Method ev_alist_expired_swap_and_push has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

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

                                    Method ev_alist_expired_swap_and_insert has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

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

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

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

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

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

                                          Method ev_alist_to_json has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                                def ev_alist_to_json(s)
                                                  hname, k, d, vn, nodes = calc_hash(s[1])
                                                  return forward1(nodes[0], s) if nodes[0] != @nid
                                          
                                                  ddata = @storages[hname].get(vn, k, 0)
                                          Severity: Minor
                                          Found in lib/roma/plugin/plugin_alist.rb - About 1 hr to fix

                                            Method ev_alist_update_at has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

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

                                              Method ev_alist_to_s has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                    def ev_alist_to_s(s)
                                                      hname, k, d, vn, nodes = calc_hash(s[1])
                                                      return forward1(nodes[0], s) if nodes[0] != @nid
                                              
                                                      ddata = @storages[hname].get(vn, k, 0)
                                              Severity: Minor
                                              Found in lib/roma/plugin/plugin_alist.rb - About 1 hr to fix

                                                Method merge_list has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                                Open

                                                      def merge_list(hname, vn, last, clk, expt, k, v, val)
                                                Severity: Major
                                                Found in lib/roma/plugin/plugin_alist.rb - About 1 hr to fix

                                                  Method ev_alist_first has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                  Open

                                                        def ev_alist_first(s)
                                                          hname, k, d, vn, nodes = calc_hash(s[1])
                                                          return forward1(nodes[0], s) if nodes[0] != @nid
                                                  
                                                          ddata = @storages[hname].get(vn, k, d)
                                                  Severity: Minor
                                                  Found in lib/roma/plugin/plugin_alist.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_alist_index has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                  Open

                                                        def ev_alist_index(s)
                                                          hname, k, d, vn, nodes = calc_hash(s[1])
                                                          data = read_bytes(s[2].to_i)
                                                          read_bytes(2)
                                                          return forward2(nodes[0], s, data) if nodes[0] != @nid
                                                  Severity: Minor
                                                  Found in lib/roma/plugin/plugin_alist.rb - About 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_alist_last has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                  Open

                                                        def ev_alist_last(s)
                                                          hname, k, d, vn, nodes = calc_hash(s[1])
                                                          return forward1(nodes[0], s) if nodes[0] != @nid
                                                  
                                                          ddata = @storages[hname].get(vn, k, d)
                                                  Severity: Minor
                                                  Found in lib/roma/plugin/plugin_alist.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 to_alist_value has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                  Open

                                                        def to_alist_value(v)
                                                          # Marshal.dump([[],[]])[0..3].unpack("cc a c")
                                                          # => [4, 8, "[", 7]
                                                          # marshal format version 4.8
                                                          # array object "["
                                                  Severity: Minor
                                                  Found in lib/roma/plugin/plugin_alist.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

                                                  Avoid too many return statements within this method.
                                                  Open

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

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

                                                          def ev_alist_include?(s)
                                                            hname, k, d, vn, nodes = calc_hash(s[1])
                                                            data = read_bytes(s[2].to_i)
                                                            read_bytes(2)
                                                            return forward2(nodes[0], s, data) if nodes[0] != @nid
                                                    Severity: Minor
                                                    Found in lib/roma/plugin/plugin_alist.rb - About 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_alist_length has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                    Open

                                                          def ev_alist_length(s)
                                                            hname, k, d, vn, nodes = calc_hash(s[1])
                                                            return forward2(nodes[0], s) if nodes[0] != @nid
                                                            ddata = @storages[hname].get(vn, k, d)
                                                            @stats.read_count += 1
                                                    Severity: Minor
                                                    Found in lib/roma/plugin/plugin_alist.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_alist_empty? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                    Open

                                                          def ev_alist_empty?(s)
                                                            hname, k, d, vn, nodes = calc_hash(s[1])
                                                            return forward2(nodes[0], s) if nodes[0] != @nid
                                                    
                                                            ddata = @storages[hname].get(vn, k, d)
                                                    Severity: Minor
                                                    Found in lib/roma/plugin/plugin_alist.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

                                                          def ev_alist_shift(s)
                                                            hname, k, d, vn, nodes = calc_hash(s[1])
                                                            return forward1(nodes[0], s) if nodes[0] != @nid
                                                    
                                                            ddata = @storages[hname].get(vn, k, d)
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 1 other location - About 4 hrs to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 810..839

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

                                                    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_alist_pop(s)
                                                            hname, k, d, vn, nodes = calc_hash(s[1])
                                                            return forward1(nodes[0], s) if nodes[0] != @nid
                                                    
                                                            ddata = @storages[hname].get(vn, k, d)
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 1 other location - About 4 hrs to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 1169..1198

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

                                                    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_alist_last(s)
                                                            hname, k, d, vn, nodes = calc_hash(s[1])
                                                            return forward1(nodes[0], s) if nodes[0] != @nid
                                                    
                                                            ddata = @storages[hname].get(vn, k, d)
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 1 other location - About 2 hrs to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 171..190

                                                    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

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

                                                          def ev_alist_first(s)
                                                            hname, k, d, vn, nodes = calc_hash(s[1])
                                                            return forward1(nodes[0], s) if nodes[0] != @nid
                                                    
                                                            ddata = @storages[hname].get(vn, k, d)
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 1 other location - About 2 hrs to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 763..782

                                                    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

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

                                                              if /(?:^(\d+)$|^(\d+)..((?:-)?\d+)$)/ =~ s[2]
                                                                if $1
                                                                  if v[0].length <= $1.to_i
                                                                    return send_data("END\r\n")
                                                                  end
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 1 other location - About 1 hr to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 641..654

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

                                                    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 /(?:^(\d+)$|^(\d+)..((?:-)?\d+)$)/ =~ s[3]
                                                                if $1
                                                                  if v[0].length <= $1.to_i
                                                                    return send_data("END\r\n")
                                                                  end
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 1 other location - About 1 hr to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 259..272

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

                                                    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/plugin/plugin_alist.rb and 1 other location - About 1 hr to fix
                                                    lib/roma/command/command_definition.rb on lines 397..410

                                                    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/plugin/plugin_alist.rb and 1 other location - About 45 mins to fix
                                                    lib/roma/command/command_definition.rb on lines 413..422

                                                    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

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

                                                              if /(?:^(\d+)$|^(\d+)..((?:-)?\d+)$)/ =~ s[2]
                                                                if $1
                                                                  if v.length <= $1.to_i
                                                                    return send_data("END\r\n")
                                                                  end
                                                    Severity: Minor
                                                    Found in lib/roma/plugin/plugin_alist.rb and 1 other location - About 40 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 692..702

                                                    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 /(?:^(\d+)$|^(\d+)..((?:-)?\d+)$)/ =~ s[3]
                                                                if $1
                                                                  if v.length <= $1.to_i
                                                                    return send_data("END\r\n")
                                                                  end
                                                    Severity: Minor
                                                    Found in lib/roma/plugin/plugin_alist.rb and 1 other location - About 40 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 211..221

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

                                                            if ret
                                                              if @stats.wb_command_map.key?(:alist_expired_swap_and_sized_insert)
                                                                Roma::WriteBehindProcess::push(hname, @stats.wb_command_map[:alist_expired_swap_and_sized_insert], k, data)
                                                              end
                                                              redundant(nodes[1..-1], hname, k, d, ret[2], expt, ret[4])
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 15 other locations - About 35 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 54..61
                                                    lib/roma/plugin/plugin_alist.rb on lines 93..100
                                                    lib/roma/plugin/plugin_alist.rb on lines 127..134
                                                    lib/roma/plugin/plugin_alist.rb on lines 366..373
                                                    lib/roma/plugin/plugin_alist.rb on lines 409..416
                                                    lib/roma/plugin/plugin_alist.rb on lines 455..462
                                                    lib/roma/plugin/plugin_alist.rb on lines 503..510
                                                    lib/roma/plugin/plugin_alist.rb on lines 552..559
                                                    lib/roma/plugin/plugin_alist.rb on lines 866..873
                                                    lib/roma/plugin/plugin_alist.rb on lines 911..918
                                                    lib/roma/plugin/plugin_alist.rb on lines 955..962
                                                    lib/roma/plugin/plugin_alist.rb on lines 1005..1012
                                                    lib/roma/plugin/plugin_alist.rb on lines 1054..1061
                                                    lib/roma/plugin/plugin_alist.rb on lines 1108..1115
                                                    lib/roma/plugin/plugin_alist.rb on lines 1147..1154

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

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

                                                            if ret
                                                              if @stats.wb_command_map.key?(:alist_expired_swap_and_sized_push)
                                                                Roma::WriteBehindProcess::push(hname, @stats.wb_command_map[:alist_expired_swap_and_sized_push], k, data)
                                                              end
                                                              redundant(nodes[1..-1], hname, k, d, ret[2], expt, ret[4])
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 15 other locations - About 35 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 54..61
                                                    lib/roma/plugin/plugin_alist.rb on lines 93..100
                                                    lib/roma/plugin/plugin_alist.rb on lines 127..134
                                                    lib/roma/plugin/plugin_alist.rb on lines 366..373
                                                    lib/roma/plugin/plugin_alist.rb on lines 409..416
                                                    lib/roma/plugin/plugin_alist.rb on lines 455..462
                                                    lib/roma/plugin/plugin_alist.rb on lines 503..510
                                                    lib/roma/plugin/plugin_alist.rb on lines 552..559
                                                    lib/roma/plugin/plugin_alist.rb on lines 603..610
                                                    lib/roma/plugin/plugin_alist.rb on lines 866..873
                                                    lib/roma/plugin/plugin_alist.rb on lines 911..918
                                                    lib/roma/plugin/plugin_alist.rb on lines 955..962
                                                    lib/roma/plugin/plugin_alist.rb on lines 1005..1012
                                                    lib/roma/plugin/plugin_alist.rb on lines 1054..1061
                                                    lib/roma/plugin/plugin_alist.rb on lines 1147..1154

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

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

                                                            if ret
                                                              if @stats.wb_command_map.key?(:alist_clear)
                                                                Roma::WriteBehindProcess::push(hname, @stats.wb_command_map[:alist_clear], k, ddata)
                                                              end
                                                              redundant(nodes[1..-1], hname, k, d, ret[2], expt, ret[4])
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 15 other locations - About 35 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 93..100
                                                    lib/roma/plugin/plugin_alist.rb on lines 127..134
                                                    lib/roma/plugin/plugin_alist.rb on lines 366..373
                                                    lib/roma/plugin/plugin_alist.rb on lines 409..416
                                                    lib/roma/plugin/plugin_alist.rb on lines 455..462
                                                    lib/roma/plugin/plugin_alist.rb on lines 503..510
                                                    lib/roma/plugin/plugin_alist.rb on lines 552..559
                                                    lib/roma/plugin/plugin_alist.rb on lines 603..610
                                                    lib/roma/plugin/plugin_alist.rb on lines 866..873
                                                    lib/roma/plugin/plugin_alist.rb on lines 911..918
                                                    lib/roma/plugin/plugin_alist.rb on lines 955..962
                                                    lib/roma/plugin/plugin_alist.rb on lines 1005..1012
                                                    lib/roma/plugin/plugin_alist.rb on lines 1054..1061
                                                    lib/roma/plugin/plugin_alist.rb on lines 1108..1115
                                                    lib/roma/plugin/plugin_alist.rb on lines 1147..1154

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

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

                                                            if ret
                                                              if @stats.wb_command_map.key?(:alist_delete_at)
                                                                Roma::WriteBehindProcess::push(hname, @stats.wb_command_map[:alist_delete_at], k, dret)
                                                              end
                                                              redundant(nodes[1..-1], hname, k, d, ret[2], expt, ret[4])
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 15 other locations - About 35 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 54..61
                                                    lib/roma/plugin/plugin_alist.rb on lines 93..100
                                                    lib/roma/plugin/plugin_alist.rb on lines 366..373
                                                    lib/roma/plugin/plugin_alist.rb on lines 409..416
                                                    lib/roma/plugin/plugin_alist.rb on lines 455..462
                                                    lib/roma/plugin/plugin_alist.rb on lines 503..510
                                                    lib/roma/plugin/plugin_alist.rb on lines 552..559
                                                    lib/roma/plugin/plugin_alist.rb on lines 603..610
                                                    lib/roma/plugin/plugin_alist.rb on lines 866..873
                                                    lib/roma/plugin/plugin_alist.rb on lines 911..918
                                                    lib/roma/plugin/plugin_alist.rb on lines 955..962
                                                    lib/roma/plugin/plugin_alist.rb on lines 1005..1012
                                                    lib/roma/plugin/plugin_alist.rb on lines 1054..1061
                                                    lib/roma/plugin/plugin_alist.rb on lines 1108..1115
                                                    lib/roma/plugin/plugin_alist.rb on lines 1147..1154

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

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

                                                            if ret
                                                              if @stats.wb_command_map.key?(:alist_swap_and_sized_insert)
                                                                Roma::WriteBehindProcess::push(hname, @stats.wb_command_map[:alist_swap_and_sized_insert], k, data)
                                                              end
                                                              redundant(nodes[1..-1], hname, k, d, ret[2], expt, ret[4])
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 15 other locations - About 35 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 54..61
                                                    lib/roma/plugin/plugin_alist.rb on lines 93..100
                                                    lib/roma/plugin/plugin_alist.rb on lines 127..134
                                                    lib/roma/plugin/plugin_alist.rb on lines 366..373
                                                    lib/roma/plugin/plugin_alist.rb on lines 409..416
                                                    lib/roma/plugin/plugin_alist.rb on lines 455..462
                                                    lib/roma/plugin/plugin_alist.rb on lines 552..559
                                                    lib/roma/plugin/plugin_alist.rb on lines 603..610
                                                    lib/roma/plugin/plugin_alist.rb on lines 866..873
                                                    lib/roma/plugin/plugin_alist.rb on lines 911..918
                                                    lib/roma/plugin/plugin_alist.rb on lines 955..962
                                                    lib/roma/plugin/plugin_alist.rb on lines 1005..1012
                                                    lib/roma/plugin/plugin_alist.rb on lines 1054..1061
                                                    lib/roma/plugin/plugin_alist.rb on lines 1108..1115
                                                    lib/roma/plugin/plugin_alist.rb on lines 1147..1154

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

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

                                                            if ret
                                                              if @stats.wb_command_map.key?(:alist_sized_push)
                                                                Roma::WriteBehindProcess::push(hname, @stats.wb_command_map[:alist_sized_push], k, data)
                                                              end
                                                              redundant(nodes[1..-1], hname, k, d, ret[2], expt, ret[4])
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 15 other locations - About 35 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 54..61
                                                    lib/roma/plugin/plugin_alist.rb on lines 93..100
                                                    lib/roma/plugin/plugin_alist.rb on lines 127..134
                                                    lib/roma/plugin/plugin_alist.rb on lines 366..373
                                                    lib/roma/plugin/plugin_alist.rb on lines 409..416
                                                    lib/roma/plugin/plugin_alist.rb on lines 455..462
                                                    lib/roma/plugin/plugin_alist.rb on lines 503..510
                                                    lib/roma/plugin/plugin_alist.rb on lines 552..559
                                                    lib/roma/plugin/plugin_alist.rb on lines 603..610
                                                    lib/roma/plugin/plugin_alist.rb on lines 866..873
                                                    lib/roma/plugin/plugin_alist.rb on lines 955..962
                                                    lib/roma/plugin/plugin_alist.rb on lines 1005..1012
                                                    lib/roma/plugin/plugin_alist.rb on lines 1054..1061
                                                    lib/roma/plugin/plugin_alist.rb on lines 1108..1115
                                                    lib/roma/plugin/plugin_alist.rb on lines 1147..1154

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

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

                                                            if ret
                                                              if @stats.wb_command_map.key?(:alist_swap_and_insert)
                                                                Roma::WriteBehindProcess::push(hname, @stats.wb_command_map[:alist_swap_and_insert], k, data)
                                                              end
                                                              redundant(nodes[1..-1], hname, k, d, ret[2], expt, ret[4])
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 15 other locations - About 35 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 54..61
                                                    lib/roma/plugin/plugin_alist.rb on lines 93..100
                                                    lib/roma/plugin/plugin_alist.rb on lines 127..134
                                                    lib/roma/plugin/plugin_alist.rb on lines 366..373
                                                    lib/roma/plugin/plugin_alist.rb on lines 409..416
                                                    lib/roma/plugin/plugin_alist.rb on lines 503..510
                                                    lib/roma/plugin/plugin_alist.rb on lines 552..559
                                                    lib/roma/plugin/plugin_alist.rb on lines 603..610
                                                    lib/roma/plugin/plugin_alist.rb on lines 866..873
                                                    lib/roma/plugin/plugin_alist.rb on lines 911..918
                                                    lib/roma/plugin/plugin_alist.rb on lines 955..962
                                                    lib/roma/plugin/plugin_alist.rb on lines 1005..1012
                                                    lib/roma/plugin/plugin_alist.rb on lines 1054..1061
                                                    lib/roma/plugin/plugin_alist.rb on lines 1108..1115
                                                    lib/roma/plugin/plugin_alist.rb on lines 1147..1154

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

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

                                                            if ret
                                                              if @stats.wb_command_map.key?(:alist_swap_and_push)
                                                                Roma::WriteBehindProcess::push(hname, @stats.wb_command_map[:alist_swap_and_push], k, data)
                                                              end
                                                              redundant(nodes[1..-1], hname, k, d, ret[2], expt, ret[4])
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 15 other locations - About 35 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 54..61
                                                    lib/roma/plugin/plugin_alist.rb on lines 93..100
                                                    lib/roma/plugin/plugin_alist.rb on lines 127..134
                                                    lib/roma/plugin/plugin_alist.rb on lines 366..373
                                                    lib/roma/plugin/plugin_alist.rb on lines 409..416
                                                    lib/roma/plugin/plugin_alist.rb on lines 455..462
                                                    lib/roma/plugin/plugin_alist.rb on lines 503..510
                                                    lib/roma/plugin/plugin_alist.rb on lines 552..559
                                                    lib/roma/plugin/plugin_alist.rb on lines 603..610
                                                    lib/roma/plugin/plugin_alist.rb on lines 866..873
                                                    lib/roma/plugin/plugin_alist.rb on lines 911..918
                                                    lib/roma/plugin/plugin_alist.rb on lines 1005..1012
                                                    lib/roma/plugin/plugin_alist.rb on lines 1054..1061
                                                    lib/roma/plugin/plugin_alist.rb on lines 1108..1115
                                                    lib/roma/plugin/plugin_alist.rb on lines 1147..1154

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

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

                                                            if ret
                                                              if @stats.wb_command_map.key?(:alist_expired_swap_and_push)
                                                                Roma::WriteBehindProcess::push(hname, @stats.wb_command_map[:alist_expired_swap_and_push], k, data)
                                                              end
                                                              redundant(nodes[1..-1], hname, k, d, ret[2], expt, ret[4])
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 15 other locations - About 35 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 54..61
                                                    lib/roma/plugin/plugin_alist.rb on lines 93..100
                                                    lib/roma/plugin/plugin_alist.rb on lines 127..134
                                                    lib/roma/plugin/plugin_alist.rb on lines 366..373
                                                    lib/roma/plugin/plugin_alist.rb on lines 409..416
                                                    lib/roma/plugin/plugin_alist.rb on lines 455..462
                                                    lib/roma/plugin/plugin_alist.rb on lines 503..510
                                                    lib/roma/plugin/plugin_alist.rb on lines 552..559
                                                    lib/roma/plugin/plugin_alist.rb on lines 603..610
                                                    lib/roma/plugin/plugin_alist.rb on lines 866..873
                                                    lib/roma/plugin/plugin_alist.rb on lines 911..918
                                                    lib/roma/plugin/plugin_alist.rb on lines 955..962
                                                    lib/roma/plugin/plugin_alist.rb on lines 1005..1012
                                                    lib/roma/plugin/plugin_alist.rb on lines 1108..1115
                                                    lib/roma/plugin/plugin_alist.rb on lines 1147..1154

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

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

                                                            if ret
                                                              if @stats.wb_command_map.key?(:alist_update_at)
                                                                Roma::WriteBehindProcess::push(hname, @stats.wb_command_map[:alist_update_at], k, data)
                                                              end
                                                              redundant(nodes[1..-1], hname, k, d, ret[2], expt, ret[4])
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 15 other locations - About 35 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 54..61
                                                    lib/roma/plugin/plugin_alist.rb on lines 93..100
                                                    lib/roma/plugin/plugin_alist.rb on lines 127..134
                                                    lib/roma/plugin/plugin_alist.rb on lines 366..373
                                                    lib/roma/plugin/plugin_alist.rb on lines 409..416
                                                    lib/roma/plugin/plugin_alist.rb on lines 455..462
                                                    lib/roma/plugin/plugin_alist.rb on lines 503..510
                                                    lib/roma/plugin/plugin_alist.rb on lines 552..559
                                                    lib/roma/plugin/plugin_alist.rb on lines 603..610
                                                    lib/roma/plugin/plugin_alist.rb on lines 866..873
                                                    lib/roma/plugin/plugin_alist.rb on lines 911..918
                                                    lib/roma/plugin/plugin_alist.rb on lines 955..962
                                                    lib/roma/plugin/plugin_alist.rb on lines 1005..1012
                                                    lib/roma/plugin/plugin_alist.rb on lines 1054..1061
                                                    lib/roma/plugin/plugin_alist.rb on lines 1108..1115

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

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

                                                            if ret
                                                              if @stats.wb_command_map.key?(:alist_insert)
                                                                Roma::WriteBehindProcess::push(hname, @stats.wb_command_map[:alist_insert], k, data)
                                                              end
                                                              redundant(nodes[1..-1], hname, k, d, ret[2], expt, ret[4])
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 15 other locations - About 35 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 54..61
                                                    lib/roma/plugin/plugin_alist.rb on lines 93..100
                                                    lib/roma/plugin/plugin_alist.rb on lines 127..134
                                                    lib/roma/plugin/plugin_alist.rb on lines 409..416
                                                    lib/roma/plugin/plugin_alist.rb on lines 455..462
                                                    lib/roma/plugin/plugin_alist.rb on lines 503..510
                                                    lib/roma/plugin/plugin_alist.rb on lines 552..559
                                                    lib/roma/plugin/plugin_alist.rb on lines 603..610
                                                    lib/roma/plugin/plugin_alist.rb on lines 866..873
                                                    lib/roma/plugin/plugin_alist.rb on lines 911..918
                                                    lib/roma/plugin/plugin_alist.rb on lines 955..962
                                                    lib/roma/plugin/plugin_alist.rb on lines 1005..1012
                                                    lib/roma/plugin/plugin_alist.rb on lines 1054..1061
                                                    lib/roma/plugin/plugin_alist.rb on lines 1108..1115
                                                    lib/roma/plugin/plugin_alist.rb on lines 1147..1154

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

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

                                                            if ret
                                                              if @stats.wb_command_map.key?(:alist_delete)
                                                                Roma::WriteBehindProcess::push(hname, @stats.wb_command_map[:alist_delete], k, data)
                                                              end
                                                              redundant(nodes[1..-1], hname, k, d, ret[2], expt, ret[4])
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 15 other locations - About 35 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 54..61
                                                    lib/roma/plugin/plugin_alist.rb on lines 127..134
                                                    lib/roma/plugin/plugin_alist.rb on lines 366..373
                                                    lib/roma/plugin/plugin_alist.rb on lines 409..416
                                                    lib/roma/plugin/plugin_alist.rb on lines 455..462
                                                    lib/roma/plugin/plugin_alist.rb on lines 503..510
                                                    lib/roma/plugin/plugin_alist.rb on lines 552..559
                                                    lib/roma/plugin/plugin_alist.rb on lines 603..610
                                                    lib/roma/plugin/plugin_alist.rb on lines 866..873
                                                    lib/roma/plugin/plugin_alist.rb on lines 911..918
                                                    lib/roma/plugin/plugin_alist.rb on lines 955..962
                                                    lib/roma/plugin/plugin_alist.rb on lines 1005..1012
                                                    lib/roma/plugin/plugin_alist.rb on lines 1054..1061
                                                    lib/roma/plugin/plugin_alist.rb on lines 1108..1115
                                                    lib/roma/plugin/plugin_alist.rb on lines 1147..1154

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

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

                                                            if ret
                                                              if @stats.wb_command_map.key?(:alist_sized_insert)
                                                                Roma::WriteBehindProcess::push(hname, @stats.wb_command_map[:alist_sized_insert], k, data)
                                                              end
                                                              redundant(nodes[1..-1], hname, k, d, ret[2], expt, ret[4])
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 15 other locations - About 35 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 54..61
                                                    lib/roma/plugin/plugin_alist.rb on lines 93..100
                                                    lib/roma/plugin/plugin_alist.rb on lines 127..134
                                                    lib/roma/plugin/plugin_alist.rb on lines 366..373
                                                    lib/roma/plugin/plugin_alist.rb on lines 455..462
                                                    lib/roma/plugin/plugin_alist.rb on lines 503..510
                                                    lib/roma/plugin/plugin_alist.rb on lines 552..559
                                                    lib/roma/plugin/plugin_alist.rb on lines 603..610
                                                    lib/roma/plugin/plugin_alist.rb on lines 866..873
                                                    lib/roma/plugin/plugin_alist.rb on lines 911..918
                                                    lib/roma/plugin/plugin_alist.rb on lines 955..962
                                                    lib/roma/plugin/plugin_alist.rb on lines 1005..1012
                                                    lib/roma/plugin/plugin_alist.rb on lines 1054..1061
                                                    lib/roma/plugin/plugin_alist.rb on lines 1108..1115
                                                    lib/roma/plugin/plugin_alist.rb on lines 1147..1154

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

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

                                                            if ret
                                                              if @stats.wb_command_map.key?(:alist_swap_and_sized_push)
                                                                Roma::WriteBehindProcess::push(hname, @stats.wb_command_map[:alist_swap_and_sized_push], k, data)
                                                              end
                                                              redundant(nodes[1..-1], hname, k, d, ret[2], expt, ret[4])
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 15 other locations - About 35 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 54..61
                                                    lib/roma/plugin/plugin_alist.rb on lines 93..100
                                                    lib/roma/plugin/plugin_alist.rb on lines 127..134
                                                    lib/roma/plugin/plugin_alist.rb on lines 366..373
                                                    lib/roma/plugin/plugin_alist.rb on lines 409..416
                                                    lib/roma/plugin/plugin_alist.rb on lines 455..462
                                                    lib/roma/plugin/plugin_alist.rb on lines 503..510
                                                    lib/roma/plugin/plugin_alist.rb on lines 552..559
                                                    lib/roma/plugin/plugin_alist.rb on lines 603..610
                                                    lib/roma/plugin/plugin_alist.rb on lines 866..873
                                                    lib/roma/plugin/plugin_alist.rb on lines 911..918
                                                    lib/roma/plugin/plugin_alist.rb on lines 955..962
                                                    lib/roma/plugin/plugin_alist.rb on lines 1054..1061
                                                    lib/roma/plugin/plugin_alist.rb on lines 1108..1115
                                                    lib/roma/plugin/plugin_alist.rb on lines 1147..1154

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

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

                                                            if ret
                                                              if @stats.wb_command_map.key?(:alist_expired_swap_and_insert)
                                                                Roma::WriteBehindProcess::push(hname, @stats.wb_command_map[:alist_expired_swap_and_insert], k, data)
                                                              end
                                                              redundant(nodes[1..-1], hname, k, d, ret[2], expt, ret[4])
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 15 other locations - About 35 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 54..61
                                                    lib/roma/plugin/plugin_alist.rb on lines 93..100
                                                    lib/roma/plugin/plugin_alist.rb on lines 127..134
                                                    lib/roma/plugin/plugin_alist.rb on lines 366..373
                                                    lib/roma/plugin/plugin_alist.rb on lines 409..416
                                                    lib/roma/plugin/plugin_alist.rb on lines 455..462
                                                    lib/roma/plugin/plugin_alist.rb on lines 503..510
                                                    lib/roma/plugin/plugin_alist.rb on lines 603..610
                                                    lib/roma/plugin/plugin_alist.rb on lines 866..873
                                                    lib/roma/plugin/plugin_alist.rb on lines 911..918
                                                    lib/roma/plugin/plugin_alist.rb on lines 955..962
                                                    lib/roma/plugin/plugin_alist.rb on lines 1005..1012
                                                    lib/roma/plugin/plugin_alist.rb on lines 1054..1061
                                                    lib/roma/plugin/plugin_alist.rb on lines 1108..1115
                                                    lib/roma/plugin/plugin_alist.rb on lines 1147..1154

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

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

                                                            if ret
                                                              if @stats.wb_command_map.key?(:alist_push)
                                                                Roma::WriteBehindProcess::push(hname, @stats.wb_command_map[:alist_push], k, data)
                                                              end
                                                              redundant(nodes[1..-1], hname, k, d, ret[2], expt, ret[4])
                                                    Severity: Major
                                                    Found in lib/roma/plugin/plugin_alist.rb and 15 other locations - About 35 mins to fix
                                                    lib/roma/plugin/plugin_alist.rb on lines 54..61
                                                    lib/roma/plugin/plugin_alist.rb on lines 93..100
                                                    lib/roma/plugin/plugin_alist.rb on lines 127..134
                                                    lib/roma/plugin/plugin_alist.rb on lines 366..373
                                                    lib/roma/plugin/plugin_alist.rb on lines 409..416
                                                    lib/roma/plugin/plugin_alist.rb on lines 455..462
                                                    lib/roma/plugin/plugin_alist.rb on lines 503..510
                                                    lib/roma/plugin/plugin_alist.rb on lines 552..559
                                                    lib/roma/plugin/plugin_alist.rb on lines 603..610
                                                    lib/roma/plugin/plugin_alist.rb on lines 911..918
                                                    lib/roma/plugin/plugin_alist.rb on lines 955..962
                                                    lib/roma/plugin/plugin_alist.rb on lines 1005..1012
                                                    lib/roma/plugin/plugin_alist.rb on lines 1054..1061
                                                    lib/roma/plugin/plugin_alist.rb on lines 1108..1115
                                                    lib/roma/plugin/plugin_alist.rb on lines 1147..1154

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

                                                    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

                                                          rescue Storage::StorageException => e
                                                            @log.error("#{e.inspect} #{$@}")
                                                            close_connection
                                                            if Config.const_defined?(:STORAGE_EXCEPTION_ACTION) &&
                                                                Config::STORAGE_EXCEPTION_ACTION == :shutdown
                                                    Severity: Minor
                                                    Found in lib/roma/plugin/plugin_alist.rb and 1 other location - About 35 mins to fix
                                                    lib/roma/command/vn_command_receiver.rb on lines 90..100

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

                                                    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/plugin/plugin_alist.rb and 1 other location - About 20 mins to fix
                                                    lib/roma/command/command_definition.rb on lines 430..434

                                                    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