borgbackup/borg

View on GitHub

Showing 507 of 611 total issues

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

    def lib_ext_kwargs(pc, prefix_env_var, lib_name, lib_pkg_name, pc_version, lib_subdir="lib"):
Severity: Minor
Found in setup.py - About 45 mins to fix

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

    def test_remote_rpc_exception_transport(remote_repository):
        with remote_repository:
            s1 = "test string"
    
            try:
    Severity: Minor
    Found in src/borg/testsuite/repository_test.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

    Consider simplifying this complex logical expression.
    Open

                    if tag in (TAG_PUT2, TAG_PUT) and is_index_object:
                        try:
                            new_segment, offset = self.io.write_put(key, data, raise_full=True)
                        except LoggedIO.SegmentFull:
                            complete_xfer()
    Severity: Major
    Found in src/borg/legacyrepository.py - About 40 mins to fix

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

          def __init__(self, path, write, filename=None, override_fd=None, integrity_data=None):
      Severity: Minor
      Found in src/borg/crypto/file_integrity.py - About 35 mins to fix

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

            def open(self, *, exclusive, lock_wait=None, lock=True):
        Severity: Minor
        Found in src/borg/repository.py - About 35 mins to fix

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

          def sizeof_fmt_iec(num, suffix="B", sep="", precision=2, sign=False):
          Severity: Minor
          Found in src/borg/helpers/parseformat.py - About 35 mins to fix

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

            def sizeof_fmt_decimal(num, suffix="B", sep="", precision=2, sign=False):
            Severity: Minor
            Found in src/borg/helpers/parseformat.py - About 35 mins to fix

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

              def acl_get(path, item, st, numeric_ids=False, fd=None):
              Severity: Minor
              Found in src/borg/platform/base.py - About 35 mins to fix

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

                def mkstemp_mode(suffix=None, prefix=None, dir=None, text=False, mode=0o600):
                Severity: Minor
                Found in src/borg/helpers/fs.py - About 35 mins to fix

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

                  def setxattr(path, name, value, *, follow_symlinks=False):
                  Severity: Minor
                  Found in src/borg/platform/base.py - About 35 mins to fix

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

                        def __init__(self, key, repository, item_keys=None, ro_cls=RepoObj):
                    Severity: Minor
                    Found in src/borg/manifest.py - About 35 mins to fix

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

                      def os_stat(*, path=None, parent_fd=None, name=None, follow_symlinks=False):
                      Severity: Minor
                      Found in src/borg/helpers/fs.py - About 35 mins to fix

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

                            def save(self, target, passphrase, algorithm, create=False):
                        Severity: Minor
                        Found in src/borg/crypto/key.py - About 35 mins to fix

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

                              def __call__(self, parser, namespace, values, option_string=None):
                          Severity: Minor
                          Found in src/borg/helpers/parseformat.py - About 35 mins to fix

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

                            def filter_archives_by_date(archives, older=None, newer=None, oldest=None, newest=None):
                            Severity: Minor
                            Found in src/borg/manifest.py - About 35 mins to fix

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

                              def clean_lines(lines, lstrip=None, rstrip=None, remove_empty=True, remove_comments=True):
                              Severity: Minor
                              Found in src/borg/helpers/parseformat.py - About 35 mins to fix

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

                                    def __call__(self, parser, namespace, path, option_string=None):
                                Severity: Minor
                                Found in src/borg/helpers/parseformat.py - About 35 mins to fix

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

                                      def __init__(self, restrict_to_paths, restrict_to_repositories, append_only, storage_quota, use_socket):
                                  Severity: Minor
                                  Found in src/borg/remote.py - About 35 mins to fix

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

                                        def init_from_given_data(self, *, crypt_key, id_key, chunk_seed):
                                    Severity: Minor
                                    Found in src/borg/crypto/key.py - About 35 mins to fix

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

                                          def save(self, target, passphrase, algorithm, create=False):
                                      Severity: Minor
                                      Found in src/borg/crypto/key.py - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language