Showing 159 of 159 total issues

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

    def setxattr(path, name, value, *, follow_symlinks=True):
Severity: Minor
Found in attic/xattr.py - About 35 mins to fix

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

        def restore_attrs(self, path, item, symlink=False, fd=None):
    Severity: Minor
    Found in attic/archive.py - About 35 mins to fix

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

          def setxattr(path, name, value, *, follow_symlinks=True):
      Severity: Minor
      Found in attic/xattr.py - About 35 mins to fix

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

            def setxattr(path, name, value, *, follow_symlinks=True):
        Severity: Minor
        Found in attic/xattr.py - About 35 mins to fix

          Function commit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def commit(self):
                  """Commit transaction
                  """
                  if not self.txn_active:
                      return
          Severity: Minor
          Found in attic/cache.py - About 35 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def __init__(self, path, exclusive=False):
                  self.path = path
                  try:
                      self.fd = open(path, 'r+')
                  except IOError:
          Severity: Minor
          Found in attic/helpers.py - About 35 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function _open_rb has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def _open_rb(path, st):
                  flags_noatime = None
                  euid = None
          
                  def open_simple(p, s):
          Severity: Minor
          Found in attic/archive.py - About 35 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function parse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def parse(self, text):
                  m = self.ssh_re.match(text)
                  if m:
                      self.proto = m.group('proto')
                      self.user = m.group('user')
          Severity: Minor
          Found in attic/helpers.py - About 35 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function preprocess_args has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def preprocess_args(self, args):
                  deprecations = [
                      ('--hourly', '--keep-hourly', 'Warning: "--hourly" has been deprecated. Use "--keep-hourly" instead.'),
                      ('--daily', '--keep-daily', 'Warning: "--daily" has been deprecated. Use "--keep-daily" instead.'),
                      ('--weekly', '--keep-weekly', 'Warning: "--weekly" has been deprecated. Use "--keep-weekly" instead.'),
          Severity: Minor
          Found in attic/archiver.py - About 35 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function update_excludes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def update_excludes(args):
              """Merge exclude patterns from files with those on command line.
              Empty lines and lines starting with '#' are ignored, but whitespace
              is not stripped."""
              if hasattr(args, 'exclude_files') and args.exclude_files:
          Severity: Minor
          Found in attic/helpers.py - About 35 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function setxattr has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def setxattr(path, name, value, *, follow_symlinks=True):
                  name = os.fsencode(name)
                  value = value and os.fsencode(value)
                  func = libc.setxattr
                  flags = 0
          Severity: Minor
          Found in attic/xattr.py - About 35 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function prepare_txn has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def prepare_txn(self, transaction_id, do_cleanup=True):
                  self._active_txn = True
                  self.lock.upgrade()
                  if not self.index:
                      self.index = self.open_index(transaction_id)
          Severity: Minor
          Found in attic/repository.py - About 35 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function posix_acl_use_stored_uid_gid has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def posix_acl_use_stored_uid_gid(acl):
              """Replace the user/group field with the stored uid/gid
              """
              entries = []
              for entry in acl.decode('ascii').split('\n'):
          Severity: Minor
          Found in attic/helpers.py - About 35 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function run_command has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def run_command(args, cwd=None, verbose=False):
              try:
                  # remember shell=False, so use git.cmd on windows, not just git
                  p = subprocess.Popen(args, stdout=subprocess.PIPE, cwd=cwd)
              except EnvironmentError:
          Severity: Minor
          Found in attic/_version.py - About 35 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function verify_chunks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def verify_chunks(self):
                  unused = set()
                  for id_, (count, size, csize) in self.chunks.iteritems():
                      if count == 0:
                          unused.add(id_)
          Severity: Minor
          Found in attic/archive.py - About 35 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function run_command has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def run_command(args, cwd=None, verbose=False):
              try:
                  # remember shell=False, so use git.cmd on windows, not just git
                  p = subprocess.Popen(args, stdout=subprocess.PIPE, cwd=cwd)
              except EnvironmentError:
          Severity: Minor
          Found in versioneer.py - About 35 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Avoid too many return statements within this function.
          Open

              return {"version": tag, "full": full}
          Severity: Major
          Found in attic/_version.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return default
            Severity: Major
            Found in versioneer.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return {}
              Severity: Major
              Found in attic/_version.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return {}
                Severity: Major
                Found in versioneer.py - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language