Fast and accurate AI powered file content types detection
This report presents the forensic synthetic code analysis of google/magika, a Python project with 17,249 GitHub stars. SynthScan v2.0 examined 52,163 lines of code across 318 source files, recording 243 pattern matches distributed across 10 syntactic categories. The overall adjusted score of 4.9 places this repository in the Likely human-written 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).
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.
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.
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.
The scanner identified 243 distinct pattern matches across 10 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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | python/tests/test_features_extraction_vs_reference.py | 59 | def test_features_extraction_vs_reference(debug: bool = False) -> None: | CODE |
| LOW⚡ | python/tests/test_features_extraction_vs_reference.py | 81 | def test_reference_generation() -> None: | CODE |
| LOW⚡ | python/tests/test_features_extraction_vs_reference.py | 85 | def _generate_reference_features_extraction(test_mode: bool) -> None: | CODE |
| LOW⚡ | python/tests/test_features_extraction_vs_reference.py | 92 | def _dump_reference_features_extraction_examples( | CODE |
| LOW | python/tests/test_features_extraction_vs_reference.py | 114 | def _generate_reference_features_extraction_tests_cases() -> List[ | CODE |
| LOW | python/tests/test_features_extraction_vs_reference.py | 145 | def _generate_reference_features_extraction_tests_cases_inputs() -> List[ | CODE |
| LOW | python/tests/test_features_extraction_vs_reference.py | 211 | def _generate_content_from_metadata( | CODE |
| LOW | python/tests/test_features_extraction_vs_reference.py | 238 | def _get_examples_from_reference() -> List[FeaturesExtractionExample]: | CODE |
| LOW | python/tests/test_features_extraction_vs_reference.py | 253 | def _check_features_vs_reference_example_features( | CODE |
| LOW⚡ | python/tests/test_magika_python_module.py | 76 | def test_magika_module_with_basic_tests_by_paths() -> None: | CODE |
| LOW⚡ | python/tests/test_magika_python_module.py | 84 | def test_magika_module_with_basic_tests_by_path() -> None: | CODE |
| LOW⚡ | python/tests/test_magika_python_module.py | 94 | def test_magika_module_with_basic_tests_by_bytes() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 36 | def test_magika_module_check_version() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 50 | def test_magika_module_with_one_test_file() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 63 | def test_magika_module_with_explicit_model_dir() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 107 | def test_magika_module_with_basic_tests_by_stream() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 120 | def test_magika_module_with_all_models() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 131 | def test_magika_module_with_previously_missdetected_samples() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 140 | def test_magika_module_with_empty_content() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 170 | def test_magika_module_with_short_content() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 208 | def test_magika_module_with_python_and_non_python_content() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 225 | def test_magika_module_identify_stream_does_not_alter_position() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 245 | def test_magika_module_with_whitespaces() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 302 | def test_magika_module_with_different_prediction_modes() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 401 | def test_magika_module_overwrite_reason() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 470 | def test_magika_module_with_directory() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 483 | def test_magika_module_multiple_copies_of_the_same_file() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 499 | def test_magika_module_with_symlink() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 528 | def test_magika_module_with_non_existing_file() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 540 | def test_magika_module_with_permission_error() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 573 | def test_magika_module_with_really_many_files() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 588 | def test_magika_module_with_big_file() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 612 | def test_api_call_with_bad_types() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 645 | def test_access_magika_result_and_prediction(): | CODE |
| LOW | python/tests/test_magika_python_module.py | 692 | def test_access_backward_compatibility_layer() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 721 | def test_get_model_and_output_content_types() -> None: | CODE |
| LOW | python/tests/test_magika_python_module.py | 795 | def get_expected_content_type_label_from_test_file_path( | CODE |
| LOW | python/tests/test_magika_python_module.py | 801 | def check_result_vs_expected_result( | CODE |
| LOW | python/tests/test_magika_python_module.py | 812 | def check_results_vs_expected_results( | CODE |
| LOW⚡ | python/tests/utils.py | 39 | def get_basic_tests_files_dir() -> Path: | CODE |
| LOW⚡ | python/tests/utils.py | 45 | def get_mitra_tests_files_dir() -> Path: | CODE |
| LOW⚡ | python/tests/utils.py | 51 | def get_previously_missdetected_files_dir() -> Path: | CODE |
| LOW⚡ | python/tests/utils.py | 57 | def get_basic_test_files_paths() -> List[Path]: | CODE |
| LOW⚡ | python/tests/utils.py | 63 | def get_mitra_test_files_paths() -> List[Path]: | CODE |
| LOW⚡ | python/tests/utils.py | 69 | def get_previously_missdetected_files_paths() -> List[Path]: | CODE |
| LOW⚡ | python/tests/utils.py | 75 | def get_reference_features_extraction_examples_path() -> Path: | CODE |
| LOW⚡ | python/tests/utils.py | 79 | def get_reference_for_inference_examples_by_path_path(model_name: str) -> Path: | CODE |
| LOW⚡ | python/tests/utils.py | 87 | def get_reference_for_inference_examples_by_content_path(model_name: str) -> Path: | CODE |
| LOW⚡ | python/tests/utils.py | 95 | def get_one_basic_test_file_path() -> Path: | CODE |
| LOW | python/tests/utils.py | 123 | def write_random_file_with_size(sample_path: Path, sample_size: int) -> None: | CODE |
| LOW | python/tests/utils.py | 177 | def get_imported_objects_after_wildcard() -> Dict[str, Any]: | CODE |
| LOW | python/tests/test_python_magika_client.py | 19 | def test_python_magika_client() -> None: | CODE |
| LOW | python/tests/test_inference_vs_reference.py | 63 | def test_inference_vs_reference(debug: bool = False) -> None: | CODE |
| LOW | python/tests/test_inference_vs_reference.py | 129 | def test_reference_generation() -> None: | CODE |
| LOW | python/tests/test_inference_vs_reference.py | 175 | def _generate_reference_for_inference(test_mode: bool) -> None: | CODE |
| LOW | python/tests/test_inference_vs_reference.py | 183 | def _generate_examples_by_path( | CODE |
| LOW | python/tests/test_inference_vs_reference.py | 226 | def _generate_examples_by_content( | CODE |
| LOW | python/tests/test_inference_vs_reference.py | 367 | def _dump_examples_by_content( | CODE |
| LOW | python/tests/test_inference_vs_reference.py | 476 | def _get_cornern_case_example( | CODE |
| LOW | python/tests/test_inference_vs_reference.py | 526 | def get_corner_case_candidates_generator( | CODE |
| 34 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | python/tests/test_features_extraction_vs_reference.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/tests/test_magika_python_module.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/tests/utils.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/tests/test_python_magika_client.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/tests/test_inference_vs_reference.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/scripts/sync.py | 1 | #!/usr/bin/env python3 | COMMENT |
| LOW | python/scripts/sync.py | 121 | python_model_dir = PYTHON_MODELS_DIR / model_name | COMMENT |
| LOW | python/scripts/sync.py | 181 | + "\n" | COMMENT |
| LOW | python/scripts/check_copyright.py | 1 | # Copyright 2025 Google LLC | COMMENT |
| LOW | python/scripts/run_quick_test_magika_module.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | python/scripts/check_source.sh | 1 | #!/bin/bash | COMMENT |
| LOW | python/scripts/check_changelog.sh | 1 | #!/bin/bash | COMMENT |
| LOW | python/scripts/pre_release_check.py | 1 | # Copyright 2025 Google LLC | COMMENT |
| LOW | python/scripts/test_magika_model.py | 1 | #!/usr/bin/env python3 | COMMENT |
| LOW | python/scripts/run_quick_test_magika_cli.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | python/scripts/generate_reference.py | 1 | # Copyright 2025 Google LLC | COMMENT |
| LOW | …hon/scripts/prepare_pyproject_for_pure_python_wheel.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/scripts/check_documentation.py | 1 | # Copyright 2025 Google LLC | COMMENT |
| LOW | python/src/magika/magika.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/src/magika/__init__.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/src/magika/logger.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/src/magika/colors.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/src/magika/types/prediction_mode.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/src/magika/types/magika_error.py | 1 | # Copyright 2025 Google LLC | COMMENT |
| LOW | python/src/magika/types/content_type_info.py | 1 | # Copyright 2025 Google LLC | COMMENT |
| LOW | python/src/magika/types/__init__.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/src/magika/types/model.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/src/magika/types/content_type_label.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/src/magika/types/overwrite_reason.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/src/magika/types/magika_prediction.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/src/magika/types/magika_result.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/src/magika/types/seekable.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/src/magika/types/strenum.py | 1 | # Copyright 2025 Google LLC | COMMENT |
| LOW | python/src/magika/types/status.py | 1 | # Copyright 2024 Google LLC | COMMENT |
| LOW | python/src/magika/cli/magika_client.py | 1 | #!/usr/bin/env python3 | COMMENT |
| LOW | …src/magika/cli/magika_rust_client_not_found_warning.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | js/magika-cli.ts | 1 | #! /usr/bin/env node | COMMENT |
| LOW | js/magika-node.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/magika.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/test/tfnHook.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/test/magika-cli.test.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/test/inference-vs-reference.test.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/test/utils.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/test/features-extraction-vs-reference.test.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/test/magika.test.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/src/model-prediction.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/src/content-type-info.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/src/status.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/src/magika-prediction.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/src/model-node.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/src/magika-result.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/src/overwrite-reason.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/src/model.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/src/content-types-infos.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/src/prediction-mode.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/src/magika-options.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/src/content-type-label.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/src/model-config-node.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/src/model-features.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| LOW | js/src/model-config.ts | 1 | // Copyright 2024 Google LLC | COMMENT |
| 32 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | python/tests/test_features_extraction_vs_reference.py | 15 | CODE | |
| LOW | python/tests/test_inference_vs_reference.py | 15 | CODE | |
| LOW | python/scripts/check_documentation.py | 18 | CODE | |
| LOW | python/src/magika/__init__.py | 20 | CODE | |
| LOW | python/src/magika/__init__.py | 21 | CODE | |
| LOW | python/src/magika/__init__.py | 22 | CODE | |
| LOW | python/src/magika/__init__.py | 23 | CODE | |
| LOW | python/src/magika/__init__.py | 24 | CODE | |
| LOW | python/src/magika/__init__.py | 25 | CODE | |
| LOW | python/src/magika/__init__.py | 26 | CODE | |
| LOW | python/src/magika/__init__.py | 27 | CODE | |
| LOW | python/src/magika/__init__.py | 28 | CODE | |
| LOW | python/src/magika/logger.py | 17 | CODE | |
| LOW | python/src/magika/types/prediction_mode.py | 17 | CODE | |
| LOW | python/src/magika/types/__init__.py | 18 | CODE | |
| LOW | python/src/magika/types/__init__.py | 19 | CODE | |
| LOW | python/src/magika/types/__init__.py | 20 | CODE | |
| LOW | python/src/magika/types/__init__.py | 21 | CODE | |
| LOW | python/src/magika/types/__init__.py | 22 | CODE | |
| LOW | python/src/magika/types/__init__.py | 23 | CODE | |
| LOW | python/src/magika/types/__init__.py | 23 | CODE | |
| LOW | python/src/magika/types/__init__.py | 23 | CODE | |
| LOW | python/src/magika/types/__init__.py | 28 | CODE | |
| LOW | python/src/magika/types/__init__.py | 29 | CODE | |
| LOW | python/src/magika/types/__init__.py | 30 | CODE | |
| LOW | python/src/magika/types/__init__.py | 31 | CODE | |
| LOW | python/src/magika/types/magika_prediction.py | 17 | CODE | |
| LOW | python/src/magika/types/strenum.py | 26 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests_data/basic/txt/lorem-small.txt | 2 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Collatio igitur ista te nihil iuvat. Honesta oratio, Socratica, | CODE |
| LOW | tests_data/basic/txt/lorem-small.txt | 2 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Collatio igitur ista te nihil iuvat. Honesta oratio, Socratica, | CODE |
| LOW⚡ | tests_data/basic/txt/lorem-big.txt | 1 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer aliquam dui sit amet justo eleifend ullamcorper. Class | CODE |
| LOW⚡ | tests_data/basic/txt/lorem-big.txt | 1 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer aliquam dui sit amet justo eleifend ullamcorper. Class | CODE |
| LOW⚡ | tests_data/basic/txt/lorem-big.txt | 7 | Ut eleifend lectus et ullamcorper interdum. Sed laoreet, quam at placerat viverra, ipsum erat rhoncus dolor, sit amet el | CODE |
| LOW⚡ | tests_data/basic/txt/lorem-big.txt | 7 | Ut eleifend lectus et ullamcorper interdum. Sed laoreet, quam at placerat viverra, ipsum erat rhoncus dolor, sit amet el | CODE |
| LOW | tests_data/basic/markdown/simple.md | 9 | Lorem ipsum? | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | python/CHANGELOG.md | 82 | print(f"Error: {result.status}") | CODE |
| LOW | python/scripts/pre_release_check.py | 81 | except Exception: | CODE |
| LOW | python/scripts/pre_release_check.py | 174 | except Exception: | CODE |
| LOW | python/scripts/run_quick_test_magika_cli.py | 52 | except Exception as e: | CODE |
| MEDIUM | website-ng/src/content/docs/cli-and-bindings/python.md | 92 | ... print(f"Error: {result.status.message}") | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | python/scripts/run_quick_test_magika_module.py | 35 | CODE | |
| LOW | python/scripts/pre_release_check.py | 147 | CODE | |
| LOW | python/scripts/run_quick_test_magika_cli.py | 37 | CODE | |
| LOW | python/scripts/check_documentation.py | 165 | CODE | |
| LOW | python/scripts/check_documentation.py | 222 | CODE | |
| LOW | python/src/magika/magika.py | 578 | CODE | |
| LOW | python/src/magika/cli/magika_client.py | 133 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | python/src/magika/magika.py | 588 | # The following code checks whether the score is "high enough", where | COMMENT |
| MEDIUM | .github/workflows/cli-release.yml | 270 | # Create a GitHub Release while uploading all files to it | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | python/scripts/sync.py | 107 | def update_python_content_type_kb() -> None: | CODE |
| LOW | python/scripts/sync.py | 154 | def update_python_content_type_label_py() -> None: | STRING |
| LOW | python/scripts/sync.py | 218 | def update_js_content_type_files() -> None: | STRING |
| LOW | python/src/magika/__init__.py | 36 | __all__ = [ | CODE |
| LOW | python/src/magika/types/__init__.py | 33 | __all__ = [ | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | python/scripts/pre_release_check.py | 166 | # Check if it is a python script | COMMENT |
| LOW | python/src/magika/magika.py | 234 | # Check if we would overwrite this target label; if not, use the | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | python/src/magika/cli/magika_client.py | 346 | CODE |