Repository Analysis

borgbackup/borg

Deduplicating archiver with compression and authenticated encryption.

20.9 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of borgbackup/borg, a Python project with 13,660 GitHub stars. SynthScan v2.0 examined 83,802 lines of code across 299 source files, recording 1672 pattern matches distributed across 15 syntactic categories. The overall adjusted score of 20.9 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

20.9
Adjusted Score
20.9
Raw Score
100%
Time Factor
2026-08-28
Last Push
13.7K
Stars
Python
Language
83.8K
Lines of Code
299
Files
1.7K
Pattern Hits
2026-08-29
Scan Date
0.04
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 13MEDIUM 80LOW 1579

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 1672 distinct pattern matches across 15 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Hyper-Verbose Identifiers914 hits · 879 pts
SeverityFileLineSnippetContext
LOWsrc/borg/fslocking.py436 def _wait_for_readers_finishing(self, remove, sleep):CODE
LOWsrc/borg/conftest.py197 def maybe_clear_flags_and_retry(func, path, _exc_info):CODE
LOWsrc/borg/patterns.py127 def get_unmatched_include_patterns(self):CODE
LOWsrc/borg/manifest.py52 def get_first_and_last_archive_ts(archives_list):CODE
LOWsrc/borg/manifest.py527 def check_repository_compatibility(self, operations):CODE
LOWsrc/borg/manifest.py541 def get_all_mandatory_features(self):CODE
LOWsrc/borg/security.py155 def assert_no_manifest_replay(self, manifest, key):CODE
LOWsrc/borg/cache.py61def discover_files_cache_names(path, files_cache_name="files"):CODE
LOWsrc/borg/cache.py351 def discover_files_cache_names(self, path):CODE
LOWsrc/borg/cache.py543def chunkindex_fragment_entry_size():CODE
LOWsrc/borg/cache.py559def list_chunkindex_fragments(repository):CODE
LOWsrc/borg/cache.py600def delete_chunkindex_invalid(repository):CODE
LOWsrc/borg/cache.py608def delete_chunkindex_from_repo(repository):CODE
LOWsrc/borg/cache.py630def _store_chunkindex_fragment(repository, batch, stored_hashes, *, force_write):CODE
LOWsrc/borg/cache.py780def read_chunkindex_from_repo(repository, hash):CODE
LOWsrc/borg/cache.py859def build_chunkindex_from_repo(CODE
LOWsrc/borg/cache.py991def archive_reference_cache_name(archive_id: bytes) -> str:CODE
LOWsrc/borg/cache.py996def list_archive_reference_caches(repository) -> set:CODE
LOWsrc/borg/cache.py1040def cleanup_archive_reference_caches(repository, stale_hex_ids: set) -> None:CODE
LOWsrc/borg/cache.py1163 def _maybe_write_chunks_index(self, now, force=False, clear=False):CODE
LOWsrc/borg/cache.py1290 def check_cache_compatibility(self):CODE
LOWsrc/borg/archive.py2368 def rebuild_archives_directory(self):CODE
LOWsrc/borg/crypto/key.py195def encryption_argument_names():CODE
LOWsrc/borg/crypto/key.py722 def get_existing_or_new_target(self, args):CODE
LOWsrc/borg/crypto/key.py750 def _find_all_keys_in_keys_dir(self):CODE
LOWsrc/borg/crypto/key.py777 def _find_key_file_from_environment(self):CODE
LOWsrc/borg/testsuite/compress_test.py187def test_additive_obfuscation(specs, c_type, obfuscation_padding: int):CODE
LOWsrc/borg/testsuite/compress_test.py225def test_default_compression_level(c_type, c_name):CODE
LOWsrc/borg/testsuite/compress_test.py238def test_specified_compression_level(c_type, c_name, c_levels):CODE
LOWsrc/borg/testsuite/compress_test.py246def test_invalid_compression_level(invalid_spec):CODE
LOWsrc/borg/testsuite/compress_test.py261def test_zstd_level_roundtrip(level):CODE
LOWsrc/borg/testsuite/compress_test.py272def test_zstd_level_roundtrip_legacy_mode(level):CODE
LOWsrc/borg/testsuite/compress_test.py282def test_other_compressors_keep_their_level_byte():CODE
LOWsrc/borg/testsuite/compress_test.py329def test_robj_specific_obfuscation(data_length, expected_padding, robj_type):CODE
LOWsrc/borg/testsuite/compress_test.py341def test_zstd_mt_workers_from_env(monkeypatch):CODE
LOWsrc/borg/testsuite/archives_test.py80def test_finish_returns_empty_dict():CODE
LOWsrc/borg/testsuite/archives_test.py90def test_ids_returns_binary_ids():CODE
LOWsrc/borg/testsuite/archives_test.py96def test_ids_store_object_not_found_gives_empty():CODE
LOWsrc/borg/testsuite/archives_test.py102def test_ids_passes_deleted_flag():CODE
LOWsrc/borg/testsuite/archives_test.py159def test_exists_name_and_id_true():CODE
LOWsrc/borg/testsuite/archives_test.py165def test_exists_name_and_id_false_wrong_name():CODE
LOWsrc/borg/testsuite/archives_test.py171def test_exists_name_and_id_false_wrong_id():CODE
LOWsrc/borg/testsuite/archives_test.py177def test_exists_name_and_ts_true():CODE
LOWsrc/borg/testsuite/archives_test.py183def test_exists_name_and_ts_false_wrong_ts():CODE
LOWsrc/borg/testsuite/archives_test.py189def test_exists_name_and_ts_false_wrong_name():CODE
LOWsrc/borg/testsuite/archives_test.py195def test_get_archive_meta_object_not_found():CODE
LOWsrc/borg/testsuite/archives_test.py258def test_get_archive_meta_bad_version():CODE
LOWsrc/borg/testsuite/archives_test.py267def test_get_missing_returns_none():CODE
LOWsrc/borg/testsuite/archives_test.py273def test_get_returns_archive_archiveinfo():CODE
LOWsrc/borg/testsuite/archives_test.py333def test_create_calls_store_store():CODE
LOWsrc/borg/testsuite/archives_test.py339def test_create_with_datetime_ts():CODE
LOWsrc/borg/testsuite/archives_test.py346def test_create_overwrite_kwarg_ignored():CODE
LOWsrc/borg/testsuite/archives_test.py523def test_get_one_no_match_raises():CODE
LOWsrc/borg/testsuite/archives_test.py529def test_get_one_multiple_matches_raises():CODE
LOWsrc/borg/testsuite/archives_test.py537def test_get_one_deleted_passes_flag():CODE
LOWsrc/borg/testsuite/archives_test.py545def test_list_considering_raises_if_name_set():CODE
LOWsrc/borg/testsuite/archives_test.py553def test_list_considering_delegates():CODE
LOWsrc/borg/testsuite/archives_test.py54def _stub_matching_info_tuples(infos):CODE
LOWsrc/borg/testsuite/archives_test.py66def test_archives_satisfies_archives_interface():CODE
LOWsrc/borg/testsuite/archives_test.py210def test_get_archive_meta_success():CODE
854 more matches not shown…
Unused Imports412 hits · 290 pts
SeverityFileLineSnippetContext
LOWscripts/errorlist.py7CODE
LOWscripts/errorlist.py8CODE
LOWsrc/borg/repoobj.py5CODE
LOWsrc/borg/repoobj.py281CODE
LOWsrc/borg/webdav.py30CODE
LOWsrc/borg/manifest.py15CODE
LOWsrc/borg/cache.py172CODE
LOWsrc/borg/cache.py172CODE
LOWsrc/borg/cache.py172CODE
LOWsrc/borg/cache.py172CODE
LOWsrc/borg/cache.py172CODE
LOWsrc/borg/fuse_impl.py8CODE
LOWsrc/borg/archive.py28CODE
LOWsrc/borg/repository.py20CODE
LOWsrc/borg/crypto/key.py17CODE
LOWsrc/borg/crypto/key.py1281CODE
LOWsrc/borg/crypto/key.py1282CODE
LOWsrc/borg/crypto/key.py1286CODE
LOWsrc/borg/crypto/keymanager.py198CODE
LOWsrc/borg/chunkers/__init__.py9CODE
LOWsrc/borg/testsuite/__init__.py23CODE
LOWsrc/borg/testsuite/__init__.py23CODE
LOWsrc/borg/testsuite/__init__.py23CODE
LOWsrc/borg/testsuite/__init__.py23CODE
LOWsrc/borg/testsuite/__init__.py23CODE
LOWsrc/borg/testsuite/chunkers/buzhash64_self_test.py8CODE
LOWsrc/borg/testsuite/chunkers/buzhash64_test.py12CODE
LOWsrc/borg/testsuite/chunkers/toeplitz_aes_test.py10CODE
LOWsrc/borg/testsuite/chunkers/fixed_self_test.py7CODE
LOWsrc/borg/testsuite/chunkers/buzhash_self_test.py8CODE
LOWsrc/borg/testsuite/chunkers/__init__.py8CODE
LOWsrc/borg/testsuite/chunkers/rabin_aes_test.py8CODE
LOWsrc/borg/testsuite/chunkers/interaction_test.py6CODE
LOWsrc/borg/testsuite/chunkers/reader_test.py9CODE
LOWsrc/borg/testsuite/chunkers/fixed_test.py10CODE
LOWsrc/borg/testsuite/chunkers/buzhash_test.py10CODE
LOWsrc/borg/testsuite/chunkers/failing_test.py6CODE
LOWsrc/borg/testsuite/chunkers/goldilocks_aes_test.py16CODE
LOWsrc/borg/testsuite/chunkers/phte_chunkers_test.py20CODE
LOWsrc/borg/testsuite/chunkers/fastcdc_test.py14CODE
LOWsrc/borg/testsuite/archiver/repo_list_cmd_test.py6CODE
LOWsrc/borg/testsuite/archiver/tar_cmds_test.py16CODE
LOWsrc/borg/testsuite/archiver/prune_cmd_test.py7CODE
LOWsrc/borg/testsuite/archiver/extract_cmd_test.py16CODE
LOWsrc/borg/testsuite/archiver/webdav_cmd_test.py23CODE
LOWsrc/borg/testsuite/archiver/match_archives_date_test.py8CODE
LOWsrc/borg/testsuite/archiver/help_cmd_test.py4CODE
LOWsrc/borg/testsuite/archiver/return_codes_test.py3CODE
LOWsrc/borg/testsuite/archiver/list_cmd_test.py5CODE
LOWsrc/borg/testsuite/archiver/recreate_cmd_test.py9CODE
LOWsrc/borg/testsuite/archiver/delete_cmd_test.py3CODE
LOWsrc/borg/testsuite/archiver/repo_compress_cmd_test.py6CODE
LOWsrc/borg/testsuite/archiver/debug_cmds_test.py5CODE
LOWsrc/borg/testsuite/archiver/compact_cmd_test.py6CODE
LOWsrc/borg/testsuite/archiver/repo_space_cmd_test.py1CODE
LOWsrc/borg/testsuite/archiver/create_cmd_test.py15CODE
LOWsrc/borg/testsuite/archiver/corruption_test.py7CODE
LOWsrc/borg/testsuite/archiver/__init__.py20CODE
LOWsrc/borg/testsuite/archiver/__init__.py29CODE
LOWsrc/borg/testsuite/archiver/repo_delete_cmd_test.py5CODE
352 more matches not shown…
Decorative Section Separators37 hits · 140 pts
SeverityFileLineSnippetContext
MEDIUMscripts/rest_perf_test.sh24# ----------------------------------------------------------------------------COMMENT
MEDIUMscripts/rest_perf_test.sh26# ----------------------------------------------------------------------------COMMENT
MEDIUMscripts/rest_perf_test.sh63# ----------------------------------------------------------------------------COMMENT
MEDIUMscripts/rest_perf_test.sh65# ----------------------------------------------------------------------------COMMENT
MEDIUMscripts/rest_perf_test.sh105# ----------------------------------------------------------------------------COMMENT
MEDIUMscripts/rest_perf_test.sh107# ----------------------------------------------------------------------------COMMENT
MEDIUMscripts/rest_perf_test.sh129# ----------------------------------------------------------------------------COMMENT
MEDIUMscripts/rest_perf_test.sh134# ----------------------------------------------------------------------------COMMENT
MEDIUMscripts/rest_perf_test.sh162# ----------------------------------------------------------------------------COMMENT
MEDIUMscripts/rest_perf_test.sh164# ----------------------------------------------------------------------------COMMENT
MEDIUMscripts/rest_perf_test.sh196# ----------------------------------------------------------------------------COMMENT
MEDIUMscripts/rest_perf_test.sh198# ----------------------------------------------------------------------------COMMENT
MEDIUMscripts/rest_perf_test.sh206# ----------------------------------------------------------------------------COMMENT
MEDIUMscripts/rest_perf_test.sh208# ----------------------------------------------------------------------------COMMENT
MEDIUMsrc/borg/testsuite/legacy_upgrade_test.py43# ── upgrade_item ──────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/legacy_upgrade_test.py117# ── upgrade_archive_metadata ──────────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/legacy_upgrade_test.py180# ── upgrade_compressed_chunk ──────────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/legacy_upgrade_test.py18# ── helpers ───────────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/legacy_helpers_test.py15# ── borg1_hardlinkable ────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/legacy_helpers_test.py46# ── borg1_hardlink_with_content ───────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/legacy_helpers_test.py71# ── borg1_hardlink_reference ──────────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/legacy_archives_test.py121# ── create ───────────────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/legacy_archives_test.py149# ── get / get_by_id ───────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/legacy_archives_test.py189# ── NotImplementedError stubs ──────────────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/legacy_archives_test.py228# ── _get_archive_meta ────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/legacy_archives_test.py415# ── get_one ───────────────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/legacy_archives_test.py438# ── list_considering ──────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/legacy_archives_test.py468# ── ArchivesInterface Protocol / Manifest dispatch ────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/legacy_archives_test.py16# ── helpers ──────────────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/legacy_archives_test.py65# ── init / raw-dict operations ───────────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/legacy_archives_test.py278# ── _infos / _info_tuples ────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/legacy_archives_test.py293# ── list ──────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/testsuite/crypto/legacy_key_test.py10# ── Pbkdf2FileMixin ───────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/borg/archiver/tar_cmds.py117 # ----------COMMENT
MEDIUMsrc/borg/archiver/tar_cmds.py125 # -----------COMMENT
MEDIUMsrc/borg/cockpit/widgets.py317 # --------------------------COMMENT
MEDIUMsrc/borg/cockpit/widgets.py328 # --------------COMMENT
Deep Nesting129 hits · 120 pts
SeverityFileLineSnippetContext
LOWscripts/lvm-thin-map.py78CODE
LOWscripts/endian_interop_test.py125CODE
LOWscripts/endian_interop_test.py182CODE
LOWscripts/endian_interop_test.py211CODE
LOWscripts/make.py71CODE
LOWscripts/make.py152CODE
LOWscripts/make.py203CODE
LOWscripts/blake3-optimize-mt-threshold.py199CODE
LOWscripts/chunker_bench.py106CODE
LOWsrc/borg/fslocking.py138CODE
LOWsrc/borg/fslocking.py216CODE
LOWsrc/borg/fslocking.py300CODE
LOWsrc/borg/webdav.py208CODE
LOWsrc/borg/webdav.py242CODE
LOWsrc/borg/webdav.py560CODE
LOWsrc/borg/webdav.py623CODE
LOWsrc/borg/webdav.py721CODE
LOWsrc/borg/version.py35CODE
LOWsrc/borg/manifest.py220CODE
LOWsrc/borg/cache.py780CODE
LOWsrc/borg/cache.py859CODE
LOWsrc/borg/cache.py287CODE
LOWsrc/borg/cache.py354CODE
LOWsrc/borg/cache.py397CODE
LOWsrc/borg/vfs.py646CODE
LOWsrc/borg/xattr.py60CODE
LOWsrc/borg/xattr.py99CODE
LOWsrc/borg/archive.py200CODE
LOWsrc/borg/archive.py370CODE
LOWsrc/borg/archive.py854CODE
LOWsrc/borg/archive.py885CODE
LOWsrc/borg/archive.py1080CODE
LOWsrc/borg/archive.py1291CODE
LOWsrc/borg/archive.py1588CODE
LOWsrc/borg/archive.py1697CODE
LOWsrc/borg/archive.py1934CODE
LOWsrc/borg/archive.py2097CODE
LOWsrc/borg/archive.py2272CODE
LOWsrc/borg/archive.py2368CODE
LOWsrc/borg/archive.py2443CODE
LOWsrc/borg/archive.py2864CODE
LOWsrc/borg/archive.py2534CODE
LOWsrc/borg/storelocking.py442CODE
LOWsrc/borg/storelocking.py610CODE
LOWsrc/borg/repository.py427CODE
LOWsrc/borg/repository.py997CODE
LOWsrc/borg/crypto/key.py508CODE
LOWsrc/borg/crypto/key.py876CODE
LOWsrc/borg/crypto/keymanager.py195CODE
LOWsrc/borg/chunkers/failing.py30CODE
LOWsrc/borg/testsuite/cache_test.py470CODE
LOWsrc/borg/testsuite/repository_test.py133CODE
LOWsrc/borg/testsuite/chunkers/buzhash64_test.py25CODE
LOWsrc/borg/testsuite/chunkers/toeplitz_aes_test.py23CODE
LOWsrc/borg/testsuite/chunkers/rabin_aes_test.py21CODE
LOWsrc/borg/testsuite/chunkers/interaction_test.py21CODE
LOWsrc/borg/testsuite/chunkers/reader_test.py415CODE
LOWsrc/borg/testsuite/chunkers/fixed_test.py13CODE
LOWsrc/borg/testsuite/chunkers/buzhash_test.py18CODE
LOWsrc/borg/testsuite/chunkers/goldilocks_aes_test.py29CODE
69 more matches not shown…
Self-Referential Comments29 hits · 90 pts
SeverityFileLineSnippetContext
MEDIUMdocs/conf.py4# This file is execfile()d with the current directory set to its containing directory.COMMENT
MEDIUMsrc/borg/testsuite/cache_test.py127 # Create an index entry so list_chunkindex_hashes finds it.COMMENT
MEDIUMsrc/borg/testsuite/repoobj_test.py179 # Create a repository object containing user data (file content data).COMMENT
MEDIUMsrc/borg/testsuite/repoobj_test.py191 # Create a repository object containing user data (file content data).COMMENT
MEDIUMsrc/borg/testsuite/crypto/csprng_test.py170 # Create a large listCOMMENT
MEDIUMsrc/borg/testsuite/crypto/crypto_test.py320 # Create a simple KeyBase subclass with a non-empty crypt_keyCOMMENT
MEDIUMsrc/borg/testsuite/chunkers/reader_test.py133 # Create a mock FileFMAPReader that yields specific chunksCOMMENT
MEDIUMsrc/borg/testsuite/chunkers/reader_test.py145 # Create a FileReader with a dummy BytesIO to satisfy the assertionCOMMENT
MEDIUMsrc/borg/testsuite/chunkers/reader_test.py271 # Create a file with all zerosCOMMENT
MEDIUMsrc/borg/testsuite/chunkers/reader_test.py288 # Create a sparse fileCOMMENT
MEDIUMsrc/borg/testsuite/chunkers/reader_test.py336 # Create a reader with sparse=FalseCOMMENT
MEDIUMsrc/borg/testsuite/archiver/tar_cmds_test.py369 # Create a simple directory structureCOMMENT
MEDIUMsrc/borg/testsuite/archiver/tar_cmds_test.py372 # Create a tar file with paths starting with './'COMMENT
MEDIUMsrc/borg/testsuite/archiver/transfer_cmd_test.py483 # Create an archive with a commentCOMMENT
MEDIUMsrc/borg/testsuite/archiver/diff_cmd_test.py54 # Create the first snapshotCOMMENT
MEDIUMsrc/borg/testsuite/archiver/diff_cmd_test.py84 # Create the second snapshotCOMMENT
MEDIUM…borg/testsuite/archiver/restricted_permissions_test.py18 # Create a repository with unrestricted permissions.COMMENT
MEDIUM…borg/testsuite/archiver/restricted_permissions_test.py43 # Create a repository first (need unrestricted permissions for that).COMMENT
MEDIUM…borg/testsuite/archiver/restricted_permissions_test.py103 # Create a repository first (need unrestricted permissions for that).COMMENT
MEDIUM…borg/testsuite/archiver/restricted_permissions_test.py107 # Create an archive to test with.COMMENT
MEDIUM…borg/testsuite/archiver/restricted_permissions_test.py152 # Create a repository first (need unrestricted permissions for that).COMMENT
MEDIUM…borg/testsuite/archiver/restricted_permissions_test.py156 # Create an initial archive to test with.COMMENT
MEDIUMsrc/borg/testsuite/helpers/fs_test.py361 # Create a directory with both a CACHEDIR.TAG and a custom tag fileCOMMENT
MEDIUMsrc/borg/testsuite/helpers/fs_test.py368 # Create a directory without any tag filesCOMMENT
MEDIUMsrc/borg/archiver/transfer_cmd.py52 # Create a chunker with the specified parametersCOMMENT
MEDIUMsrc/borg/archiver/repo_space_cmd.py70 # Create a new repository:STRING
MEDIUMsrc/borg/archiver/help_cmd.py227 # Define the recursion rootSTRING
MEDIUMsrc/borg/legacy/fs.py111 # This file is a cache directory tag created by Borg.STRING
MEDIUMsrc/borg/helpers/fs.py136 # This file is a cache directory tag created by Borg.STRING
Cross-Language Confusion13 hits · 68 pts
SeverityFileLineSnippetContext
HIGHsrc/borg/archiver/completion_cmd.py133 out=$( {PROG} repo-list "${repo_arg[@]}" --format '{id}{NL}' 2>/dev/null </dev/null )CODE
HIGHsrc/borg/archiver/completion_cmd.py135 out=$( {PROG} repo-list --format '{id}{NL}' 2>/dev/null </dev/null )CODE
HIGHsrc/borg/archiver/completion_cmd.py152 out=$( {PROG} repo-list "${repo_arg[@]}" --format '{archive}{NL}' 2>/dev/null </dev/null )CODE
HIGHsrc/borg/archiver/completion_cmd.py154 out=$( {PROG} repo-list --format '{archive}{NL}' 2>/dev/null </dev/null )CODE
HIGHsrc/borg/archiver/completion_cmd.py210 out=$( {PROG} repo-list "${repo_arg[@]}" --format '{tags}{NL}' 2>/dev/null </dev/null )CODE
HIGHsrc/borg/archiver/completion_cmd.py212 out=$( {PROG} repo-list --format '{tags}{NL}' 2>/dev/null </dev/null )CODE
HIGHsrc/borg/archiver/completion_cmd.py367 2>/dev/null </dev/null )CODE
HIGHsrc/borg/archiver/completion_cmd.py370 2>/dev/null </dev/null )CODE
HIGHsrc/borg/archiver/completion_cmd.py394 out=$( {PROG} repo-list "${repo_arg[@]}" --format '{archive}{NL}' 2>/dev/null </dev/null )CODE
HIGHsrc/borg/archiver/completion_cmd.py396 out=$( {PROG} repo-list --format '{archive}{NL}' 2>/dev/null </dev/null )CODE
HIGHsrc/borg/archiver/completion_cmd.py458 out=$( {PROG} repo-list "${repo_arg[@]}" --format '{tags}{NL}' 2>/dev/null </dev/null )CODE
HIGHsrc/borg/archiver/completion_cmd.py460 out=$( {PROG} repo-list --format '{tags}{NL}' 2>/dev/null </dev/null )CODE
HIGHsrc/borg/archiver/completion_cmd.py784 '{PROG} repo-list "$@" --format "{archive}{NL}" 2>/dev/null </dev/null; 'STRING
Excessive Try-Catch Wrapping51 hits · 60 pts
SeverityFileLineSnippetContext
LOWscripts/blake3-optimize-mt-threshold.py125 except Exception:CODE
LOWsrc/borg/webdav.py450 except Exception:CODE
MEDIUMsrc/borg/webdav.py445def _guarded(self, method, *args):CODE
LOWsrc/borg/conftest.py32 except Exception:CODE
LOWsrc/borg/conftest.py64 except Exception: # nosec B110CODE
LOWsrc/borg/cache.py884 except Exception as err:CODE
LOWsrc/borg/cache.py1278 except Exception as exc:CODE
LOWsrc/borg/fuse_impl.py23 except Exception as err:CODE
LOWsrc/borg/fuse_impl.py36 except Exception as err:CODE
LOWsrc/borg/fuse_impl.py49 except Exception as err: # mfusepy raises OSError (not ImportError) if libfuse is missingCODE
LOWsrc/borg/logger.py186 except Exception as err: # XXX be more preciseCODE
LOWsrc/borg/digests.py121 except Exception: # hashing is not expected to fail, but we must not die with a full queueCODE
LOWsrc/borg/archive.py2604 except Exception:CODE
LOWsrc/borg/storelocking.py621 except Exception as e:CODE
LOWsrc/borg/repository.py767 except Exception:CODE
LOWsrc/borg/repository.py964 except Exception as exc:CODE
LOWsrc/borg/crypto/key.py839 except Exception as exc: # noqa: BLE001 - a corrupted borg key must not break unlocking via the othersCODE
LOWsrc/borg/crypto/key.py947 except Exception as exc: # noqa: BLE001 - a corrupted borg key must stay visible and removableCODE
MEDIUMsrc/borg/crypto/key.py533def _load(self, key_data, passphrase):CODE
LOWsrc/borg/crypto/keymanager.py76 except Exception: # noqa: BLE001 - best-effort: a borg key without a parseable envelope has no labelCODE
LOWsrc/borg/testsuite/logger_test.py67 except Exception:CODE
LOWsrc/borg/testsuite/archiver/extract_cmd_test.py835 except Exception:CODE
LOWsrc/borg/testsuite/archiver/remote_repo_test.py26 except Exception:CODE
LOWsrc/borg/testsuite/archiver/remote_repo_test.py31 except Exception:CODE
LOWsrc/borg/testsuite/helpers/lrucache_test.py124 except Exception as e:CODE
LOWsrc/borg/archiver/__init__.py552 except Exception:CODE
LOWsrc/borg/archiver/__init__.py560 except Exception:CODE
LOWsrc/borg/archiver/__init__.py634 except Exception:STRING
LOWsrc/borg/archiver/__init__.py674 except Exception as e:STRING
LOWsrc/borg/legacy/remote.py285 except Exception:CODE
MEDIUMsrc/borg/legacy/remote.py71def __init__(self, data):CODE
LOWsrc/borg/legacy/fs.py48 except Exception:CODE
LOWsrc/borg/legacy/fs.py54 except Exception: # nosec B110CODE
LOWsrc/borg/legacy/fs.py71 except Exception: # nosec B110CODE
LOWsrc/borg/legacy/repository.py998 except Exception as exc:CODE
LOWsrc/borg/cockpit/runner.py58 except Exception as e:CODE
LOWsrc/borg/helpers/time.py266 except Exception:CODE
LOWsrc/borg/helpers/msgpack.py105 except Exception as e:CODE
LOWsrc/borg/helpers/msgpack.py113 except Exception as e:CODE
LOWsrc/borg/helpers/msgpack.py121 except Exception as e:CODE
LOWsrc/borg/helpers/msgpack.py163 except Exception as e:CODE
LOWsrc/borg/helpers/msgpack.py171 except Exception as e:CODE
LOWsrc/borg/helpers/msgpack.py184 except Exception as e:CODE
LOWsrc/borg/helpers/msgpack.py195 except Exception as e:CODE
MEDIUMsrc/borg/helpers/msgpack.py102def pack(self, obj):CODE
MEDIUMsrc/borg/helpers/msgpack.py158def unpack(self):CODE
MEDIUMsrc/borg/helpers/msgpack.py166def __next__(self):CODE
LOWsrc/borg/helpers/__init__.py217 except Exception: # nosec B110CODE
LOWsrc/borg/helpers/process.py406 except Exception:CODE
LOWsrc/borg/helpers/parseformat.py508 except Exception as e:CODE
MEDIUMsrc/borg/helpers/parseformat.py52def hex_to_bin(hex, length=None):CODE
Over-Commented Block42 hits · 41 pts
SeverityFileLineSnippetContext
LOWdocs/conf.py1# Documentation build configuration file, created byCOMMENT
LOWdocs/conf.py61# language = NoneCOMMENT
LOWdocs/conf.py81# add_function_parentheses = TrueCOMMENT
LOWdocs/conf.py121COMMENT
LOWdocs/conf.py181COMMENT
LOWscripts/rest_perf_test.sh1#!/usr/bin/env bashCOMMENT
LOW.github/workflows/release.yml1# Release automation: build the source distribution, publish it to PyPI andCOMMENT
LOW.github/workflows/32bit.yml1# 32-bit test: build and test borg on armv7 (32-bit) under qemu user-modeCOMMENT
LOW.github/workflows/fame.yml1# Refresh FAME.md and FAME.svg, the contributor summary generated byCOMMENT
LOW.github/workflows/ci.yml101 # a detailed error report to stderr, including a stack trace, and forces the process to exit withCOMMENT
LOW.github/workflows/ci.yml861 # This job can not live in release.yml with the rest of the release code:COMMENT
LOW.github/workflows/bigendian.yml1# Big-endian test: build and test borg on s390x (big-endian) under qemuCOMMENT
LOWsrc/borg/paperkey.html21// https://github.com/kazuhikoarase/qrcode-generator/blob/master/js/qrcode.jsCOMMENT
LOWsrc/borg/constants.py81COMMENT
LOWsrc/borg/constants.py121# borg serve (borg.legacy.remote) read() buffer sizeCOMMENT
LOWsrc/borg/cache.py661 # CHUNKINDEX_FRAGMENT_ENTRIES_MAX entries, so no single fragment gets too large (even the oneCOMMENT
LOWsrc/borg/cache.py741COMMENT
LOWsrc/borg/cache.py861):COMMENT
LOWsrc/borg/storelocking.py341 # refresh): we are obviously alive and can refresh or release it, so it must neverCOMMENT
LOWsrc/borg/storelocking.py361 # residual risk: a store clock that steps BACK by more than the stale timeout duringCOMMENT
LOWsrc/borg/storelocking.py561 try:COMMENT
LOWsrc/borg/repository.py961 # while unwinding an error, a pack store may still be in flight: join it, so a storedCOMMENT
LOWsrc/borg/crypto/key.py41KEYFILE_ID = "BORG_KEY"COMMENT
LOWsrc/borg/crypto/key.py281 # IDHASH_NAME -> "borg repo-create --id-hash" (id hash function)COMMENT
LOWsrc/borg/crypto/key.py301 # Whether a key of this class may be stored as a keyfile or as a repokey (configurable atCOMMENT
LOWsrc/borg/crypto/key.py321 id_check_is_authentication: ClassVar[bool] = TrueCOMMENT
LOWsrc/borg/crypto/key.py1361 id_check_is_authentication = FalseCOMMENT
LOWsrc/borg/testsuite/legacyrepository_test.py441 # this tests the shadowing-by-double-put behaviour, see issue #5661COMMENT
LOWsrc/borg/testsuite/archiver/prune_cmd_test.py201COMMENT
LOWsrc/borg/testsuite/archiver/__init__.py121 return exec_fnCOMMENT
LOWsrc/borg/testsuite/archiver/__init__.py261 os.symlink("somewhere", os.path.join(input_path, "link1"))COMMENT
LOWsrc/borg/testsuite/archiver/__init__.py521def fuse_mount(archiver, mountpoint=None, *options, fork=True, os_fork=False, **kwargs):COMMENT
LOWsrc/borg/archiver/tar_cmds.py121 # - possibly Linux capabilities, security.* xattrs (TODO)COMMENT
LOWsrc/borg/archiver/tar_cmds.py361 # For one the compressor runs on the same thread as the program using theCOMMENT
LOWsrc/borg/archiver/__init__.py341 # which might be different in the case of a forced command or same otherwise.COMMENT
LOWsrc/borg/legacy/remote.py81class ConnectionBrokenWithHint(Error):COMMENT
LOWsrc/borg/legacy/remote.py341COMMENT
LOWsrc/borg/legacy/repository.py661 # (which may grow the index up to twice its current size).COMMENT
LOWsrc/borg/legacy/repository.py821 # However, this only happens if the crash also affects the FS to the effect that file deletionsCOMMENT
LOWsrc/borg/legacy/repository.py841 # Now we crash. But only segment 2 gets deleted, while segment 1 is still around. Now key 1COMMENT
LOWsrc/borg/helpers/process.py341 # (non-matching) libraries from there.COMMENT
LOWsrc/borg/helpers/parseformat.py741 # locations that borg parses itself, see ssh_re / rest_re / file_re below.COMMENT
AI Slop Vocabulary13 hits · 25 pts
SeverityFileLineSnippetContext
MEDIUMscripts/rest_perf_test.sh3# rest_perf_test.sh - borg2 performance harness for rest:// repositories.COMMENT
LOWsrc/borg/archive.py974 # we just use the existing one and do not remove it.COMMENT
LOWsrc/borg/archive.py2362 # collecting any key we encounter in a damaged repo seems unwise, thus we just useCOMMENT
MEDIUMsrc/borg/archive.py2074 """A restartable/robust version of the streaming msgpack unpacker"""STRING
LOWsrc/borg/crypto/key.py1482# setting: the advantages of the individual session keys just add up, so the quantity that mattersCOMMENT
LOWsrc/borg/testsuite/repoobj_test.py119 # Here, we just use len_data. For Borg transfer, we also know the size from another metadata source.COMMENT
MEDIUMsrc/borg/testsuite/platform/linux_test.py88 # Testing non-ASCII ACL processing to see whether our code is robust.STRING
LOWsrc/borg/testsuite/archiver/extract_cmd_test.py1048 # we should just use the existing directory and not remove/recreate it.COMMENT
MEDIUMsrc/borg/testsuite/archiver/completion_cmd_test.py649 # the harness' compadd stub prints the candidates - replace it by one printing the descriptionsCOMMENT
MEDIUMsrc/borg/testsuite/archiver/benchmark_cmd_test.py23 # Filter for JSON lines only; the test harness merges stdout and stderr,COMMENT
MEDIUMsrc/borg/legacy/fs.py38 # 2. Prefer HOME, but be robust against mount helpers that set HOME to root's home for non-root users.COMMENT
LOWsrc/borg/helpers/fs.py532 fname, parent_fd = path, None # just use the pathCODE
LOWsrc/borg/helpers/fs.py577 fname, parent_fd = path, None # just use the pathCODE
AI Structural Patterns13 hits · 12 pts
SeverityFileLineSnippetContext
LOWsrc/borg/manifest.py108CODE
LOWsrc/borg/manifest.py365CODE
LOWsrc/borg/vfs.py72CODE
LOWsrc/borg/archive.py560CODE
LOWsrc/borg/archive.py2136CODE
LOWsrc/borg/archive.py2443CODE
LOWsrc/borg/archive.py2732CODE
LOWsrc/borg/testsuite/archiver/__init__.py186CODE
LOWsrc/borg/archiver/_common.py79CODE
LOWsrc/borg/archiver/__init__.py591CODE
LOWsrc/borg/legacy/archives.py210CODE
LOWsrc/borg/helpers/msgpack.py126CODE
LOWsrc/borg/helpers/yes_no.py17CODE
Redundant / Tautological Comments5 hits · 8 pts
SeverityFileLineSnippetContext
LOWsrc/borg/archiver/completion_cmd.py125 # Check if completing aid: prefixCOMMENT
LOWsrc/borg/archiver/completion_cmd.py356 # Check if completing aid: prefixCOMMENT
LOWsrc/borg/archiver/transfer_cmd.py59 # Check if the chunk is already in the repositoryCOMMENT
LOWsrc/borg/archiver/list_cmd.py68 # Check if the item matches the patterns/paths.COMMENT
LOWsrc/borg/archiver/__init__.py513 # Open the file early, before running the main program, to avoidCOMMENT
Fake / Example Data6 hits · 7 pts
SeverityFileLineSnippetContext
LOWsrc/borg/paperkey.html2346 typein.classList.add("placeholder");CODE
LOWsrc/borg/paperkey.html2347 svg.classList.add("placeholder");CODE
LOWsrc/borg/paperkey.html2357 typein.classList.remove("placeholder");CODE
LOWsrc/borg/paperkey.html2358 svg.classList.remove("placeholder");CODE
LOWsrc/borg/testsuite/legacyrepository_test.py956 assert remote_repository.ssh_cmd(Location("ssh://user@example.com/foo")) == ["ssh", "user@example.com"]CODE
LOWsrc/borg/testsuite/legacyrepository_test.py961 "user@example.com",CODE
Slop Phrases3 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMsrc/borg/constants.py262 # if you still need to, you can use "borg key migrate-to-repokey" with borg 1.0, 1.1 and 1.2.COMMENT
LOWsrc/borg/archiver/create_cmd.py563 # we better do a fresh stat on the file, just to make sure to get the current fileCOMMENT
LOWsrc/borg/legacy/upgrade.py62 # make sure we only have desired stuff in the new item. specifically, make sure to get rid of:COMMENT
Modern Structural Boilerplate4 hits · 4 pts
SeverityFileLineSnippetContext
LOWsrc/borg/repoobj.py118 def set_assert_id_place(self, place: str) -> None:CODE
LOWsrc/borg/legacy/repoobj.py15 def set_assert_id_place(self, place: str) -> None:CODE
LOWsrc/borg/cockpit/widgets.py197 def _update_art(self) -> None:CODE
LOWsrc/borg/cockpit/widgets.py256 def update_art(self) -> None:CODE
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippetContext
LOWscripts/rest_perf_test.sh15# Usage:COMMENT