borgbackup/borg

View on GitHub

Showing 507 of 611 total issues

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

def text_validator(*, name, max_length, min_length=0, invalid_ctrl_chars="\0", invalid_chars="", no_blanks=False):
Severity: Major
Found in src/borg/helpers/parseformat.py - About 50 mins to fix

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

    def setup_logging(
    Severity: Major
    Found in src/borg/logger.py - About 50 mins to fix

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

      def sizeof_fmt(num, suffix="B", units=None, power=None, sep="", precision=2, sign=False):
      Severity: Major
      Found in src/borg/helpers/parseformat.py - About 50 mins to fix

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

            def process_dev(self, *, path, parent_fd, name, st, dev_type, strip_prefix):
        Severity: Major
        Found in src/borg/archive.py - About 50 mins to fix

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

              def _read(self, fd, header, segment, offset, acceptable_tags, read_data=True):
          Severity: Major
          Found in src/borg/legacyrepository.py - About 50 mins to fix

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

            def get_item_uid_gid(item, *, numeric, uid_forced=None, gid_forced=None, uid_default=0, gid_default=0):
            Severity: Major
            Found in src/borg/archive.py - About 50 mins to fix

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

              def OsOpen(*, flags, path=None, parent_fd=None, name=None, noatime=False, op="open"):
              Severity: Major
              Found in src/borg/archive.py - About 50 mins to fix

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

                    def process_pipe(self, *, path, cache, fd, mode, user=None, group=None):
                Severity: Major
                Found in src/borg/archive.py - About 50 mins to fix

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

                  def cache_if_remote(repository, *, decrypted_cache=False, pack=None, unpack=None, transform=None, force_cache=False):
                  Severity: Major
                  Found in src/borg/legacyremote.py - About 50 mins to fix

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

                        def read(self, segment, offset, id, *, read_data=True, expected_size=None):
                    Severity: Major
                    Found in src/borg/legacyrepository.py - About 50 mins to fix

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

                      def with_repository(
                      Severity: Major
                      Found in src/borg/archiver/_common.py - About 50 mins to fix

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

                        def compat_check(*, create, manifest, key, cache, compatibility, decorator_name):
                        Severity: Major
                        Found in src/borg/archiver/_common.py - About 50 mins to fix

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

                          def find_chunks(repository, repo_objs, cache, stats, ctype, clevel, olevel):
                          Severity: Major
                          Found in src/borg/archiver/repo_compress_cmd.py - About 50 mins to fix

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

                                def do_transfer(self, args, *, repository, manifest, cache, other_repository=None, other_manifest=None):
                            Severity: Major
                            Found in src/borg/archiver/transfer_cmd.py - About 50 mins to fix

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

                                  def add_chunk(self, id, meta, data, stats=None, wait=True, ro_type=None):
                              Severity: Major
                              Found in src/borg/testsuite/archive_test.py - About 50 mins to fix

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

                                def exec_cmd(*args, archiver=None, fork=False, exe=None, input=b"", binary_output=False, **kw):
                                Severity: Major
                                Found in src/borg/testsuite/archiver/__init__.py - About 50 mins to fix

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

                                          def acquire_release_loop(
                                  Severity: Major
                                  Found in src/borg/testsuite/fslocking_test.py - About 50 mins to fix

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

                                        def _process_leaf(self, name, item, parent, prefix, is_dir, item_inode, hlm):
                                    Severity: Major
                                    Found in src/borg/fuse.py - About 50 mins to fix

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

                                          def argon2(
                                      Severity: Minor
                                      Found in src/borg/crypto/key.py - About 45 mins to fix

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

                                        def cache_if_remote(repository, *, decrypted_cache=False, pack=None, unpack=None, transform=None, force_cache=False):
                                            """
                                            Return a Repository(No)Cache for *repository*.
                                        
                                            If *decrypted_cache* is a repo_objs object, then get and get_many will return a tuple
                                        Severity: Minor
                                        Found in src/borg/remote.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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language