rgs1/zk_shell

View on GitHub

Showing 84 of 141 total issues

Function get has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def get(self, exclude_recurse=None):
        """
        Paths matching exclude_recurse will not be recursed.
        """
        reqs = Queue()
Severity: Minor
Found in zk_shell/tree.py - 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

Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self,
Severity: Major
Found in zk_shell/shell.py - About 1 hr to fix

    Function fetch has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            def fetch(endpoint, states, znodes, ephemerals, datasize, sessions, zxids, idx):
    Severity: Major
    Found in zk_shell/shell.py - About 1 hr to fix

      Function find_outliers has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      def find_outliers(group, delta):
          """
          given a list of values, find those that are apart from the rest by
          `delta`. the indexes for the outliers is returned, if any.
      
      
      Severity: Minor
      Found in zk_shell/util.py - 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

      Function do_exists has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def do_exists(self, params):
              """
      \x1b[1mNAME\x1b[0m
              exists - Gets the znode's stat information
      
      
      Severity: Minor
      Found in zk_shell/shell.py - 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

      Function do_summary has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def do_summary(self, params):
              """
      \x1b[1mNAME\x1b[0m
              summary - Prints summarized details of a path's children
      
      
      Severity: Minor
      Found in zk_shell/shell.py - 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

      Function create_async has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def create_async(self, path, value=b"", acl=None, ephemeral=False, sequence=False, makepath=False):
      Severity: Major
      Found in zk_shell/xclient.py - About 50 mins to fix

        Function create has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def create(self, path, value=b"", acl=None, ephemeral=False, sequence=False, makepath=False):
        Severity: Major
        Found in zk_shell/xclient.py - About 50 mins to fix

          Function do_tree has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def do_tree(self, path, max_depth, level, full_path, include_stat):
          Severity: Minor
          Found in zk_shell/xclient.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if mirror and child in dst_children:
                                        dst_children.remove(child)
                                    if max_items > 0 and i == max_items:
            Severity: Major
            Found in zk_shell/copy_util.py - About 45 mins to fix

              Function to_type has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def to_type(value, ptype):
                  """ Convert value to ptype """
                  if ptype == 'str':
                      return str(value)
                  elif ptype == 'int':
              Severity: Minor
              Found in zk_shell/keys.py - 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

              Function do_json_append has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def do_json_append(self, params):
                      """
              \x1b[1mNAME\x1b[0m
                      json_append - append an element to a list
              
              
              Severity: Minor
              Found in zk_shell/shell.py - 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

              Function fetch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def fetch(cls, obj, keys):
                      """
                      fetches the value corresponding to keys from obj
                      """
                      current = obj
              Severity: Minor
              Found in zk_shell/keys.py - 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 deeply nested control flow statements.
              Open

                                      if max_items > 0 and i == max_items:
                                          break
                                      self.set_url(os.path.join(src_url, child))
              Severity: Major
              Found in zk_shell/copy_util.py - About 45 mins to fix

                Function set has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def set(cls, obj, keys, value, fill_list_value=None):
                Severity: Minor
                Found in zk_shell/keys.py - About 35 mins to fix

                  Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __init__(self, sid=None, ip=None, port=None, server_ip=None, server_port=None):
                  Severity: Minor
                  Found in zk_shell/xclient.py - About 35 mins to fix

                    Function create has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def create(self, path, value=b"", acl=None, ephemeral=False,
                    Severity: Minor
                    Found in zk_shell/xclient.py - About 35 mins to fix

                      Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def __init__(self, parse_result, exists, asynchronous, verbose):
                      Severity: Minor
                      Found in zk_shell/copy_util.py - About 35 mins to fix

                        Function copy has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def copy(self, params, recursive, overwrite, max_items, mirror):
                        Severity: Minor
                        Found in zk_shell/shell.py - About 35 mins to fix

                          Function tree has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def tree(self, path, max_depth, full_path=False, include_stat=False):
                          Severity: Minor
                          Found in zk_shell/xclient.py - About 35 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language