Showing 333 of 491 total issues

Avoid too many return statements within this method.
Open

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

    Avoid too many return statements within this method.
    Open

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

      Avoid too many return statements within this method.
      Open

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

        Avoid too many return statements within this method.
        Open

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

          Avoid too many return statements within this method.
          Open

                  return send_data("NOT_FOUND\r\n") unless res[4]
          Severity: Major
          Found in lib/roma/plugin/plugin_storage.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return send_data("NOT_DELETED\r\n") unless res
            Severity: Major
            Found in lib/roma/plugin/plugin_storage.rb - About 30 mins to fix

              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

                Avoid too many return statements within this method.
                Open

                        return send_data("NOT_FOUND\r\n") unless res[4]
                Severity: Major
                Found in lib/roma/plugin/plugin_storage.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                        return true
                  Severity: Major
                  Found in lib/roma/async_process.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                          return true
                    Severity: Major
                    Found in lib/roma/async_process.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                            return false
                      Severity: Major
                      Found in lib/roma/tools/mkconfig.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                      return true
                        Severity: Major
                        Found in lib/roma/tools/mkconfig.rb - About 30 mins to fix

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

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

                          Cognitive Complexity

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

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

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

                          Further reading

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

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

                          Cognitive Complexity

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

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

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

                          Further reading

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

                                def ev_reqpushv(s)
                                  if s.length!=4
                                    send_data("CLIENT_ERROR usage:reqpushv vnode-id node-id primary-flag(true/false)\r\n")
                                    return
                                  end
                          Severity: Minor
                          Found in lib/roma/command/vn_command_receiver.rb - About 25 mins to fix

                          Cognitive Complexity

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

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

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

                          Further reading

                          Method ev_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

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

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

                          Cognitive Complexity

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

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

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

                          Further reading

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

                                def ev_fget(s)
                                  key,hname = s[1].split("\e")
                                  hname ||= @defhash
                                  d = Digest::SHA1.hexdigest(key).hex % @rttable.hbits
                                  vn = @rttable.get_vnode_id(d)
                          Severity: Minor
                          Found in lib/roma/plugin/plugin_storage.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

                          Severity
                          Category
                          Status
                          Source
                          Language