a small build system with a focus on speed
This report presents the forensic synthetic code analysis of ninja-build/ninja, a C++ project with 13,104 GitHub stars. SynthScan v2.0 examined 11,965 lines of code across 78 source files, recording 147 pattern matches distributed across 10 syntactic categories. The overall adjusted score of 14.1 places this repository in the Low 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).
Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.
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 147 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 | configure.py | 1 | #!/usr/bin/env python3 | COMMENT |
| LOW | misc/ninja_syntax_test.py | 1 | #!/usr/bin/env python3 | COMMENT |
| LOW | misc/measure.py | 1 | #!/usr/bin/env python3 | COMMENT |
| LOW | misc/jobserver_test.py | 1 | #!/usr/bin/env python3 | COMMENT |
| LOW | misc/ninja_syntax.py | 1 | #!/usr/bin/python | COMMENT |
| LOW | misc/jobserver_test_helper.py | 1 | #!/usr/bin/env python3 | COMMENT |
| LOW | misc/jobserver_pool.py | 1 | #!/usr/bin/env python3 | COMMENT |
| LOW | misc/jobserver_pool.py | 41 | # | COMMENT |
| LOW | misc/output_test.py | 21 | default_env.pop('NINJA_STATUS', None) | COMMENT |
| LOW | misc/output_test.py | 41 | # [ '\r', 'FOO\x1b[K\r', 'BAR\x1b[K\r', 'ZOO\x1b[K\r\n' ] | COMMENT |
| LOW | misc/oss-fuzz/build.sh | 1 | #!/bin/bash -eu | COMMENT |
| LOW | src/browse.py | 1 | #!/usr/bin/env python3 | COMMENT |
| LOW | src/browse.py | 41 | except ImportError: | COMMENT |
| LOW | src/edit_distance.h | 1 | // Copyright 2011 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/graphviz.h | 1 | // Copyright 2011 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/manifest_parser.h | 1 | // Copyright 2011 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/version.h | 1 | // Copyright 2013 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/status.h | 1 | // Copyright 2016 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/build_log.h | 1 | // Copyright 2011 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/build_log.h | 21 | #include <string> | COMMENT |
| LOW | src/hash_map.h | 1 | // Copyright 2011 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/dyndep_parser.h | 1 | // Copyright 2015 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/includes_normalize.h | 1 | // Copyright 2012 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/clean.h | 1 | // Copyright 2011 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/clean.h | 41 | int CleanTarget(const char* target); | COMMENT |
| LOW | src/dyndep.h | 1 | // Copyright 2015 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/exit_status.h | 1 | // Copyright 2011 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/build.h | 1 | // Copyright 2011 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/build.h | 121 | /// Update plan with knowledge that the given node is up to date. | COMMENT |
| LOW | src/parser.h | 1 | // Copyright 2018 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/clparser.h | 1 | // Copyright 2015 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/clparser.h | 21 | /// Visual Studio's cl.exe requires some massaging to work with Ninja; | COMMENT |
| LOW | src/command_collector.h | 1 | // Copyright 2024 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/command_collector.h | 21 | COMMENT | |
| LOW | src/depfile_parser.h | 1 | // Copyright 2011 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/build_result.h | 1 | // Copyright 2026 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/elide_middle.h | 1 | // Copyright 2024 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/elide_middle.h | 21 | /// Elide the given string @a str with '...' in the middle if the length | COMMENT |
| LOW | src/test.h | 1 | // Copyright 2011 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/inline.sh | 1 | #!/bin/sh | COMMENT |
| LOW | src/missing_deps.h | 1 | // Copyright 2019 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/string_piece.h | 1 | // Copyright 2011 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/eval_env.h | 1 | // Copyright 2011 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/graph.h | 1 | // Copyright 2011 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/graph.h | 141 | /// The path is an actual file. mtime_ will be the file's mtime. | COMMENT |
| LOW | src/graph.h | 461 | COMMENT | |
| LOW | src/graph.h | 481 | /// - Call VisitNode() for each root node to collect inputs from. | COMMENT |
| LOW | src/status_printer.h | 1 | // Copyright 2016 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/msvc_helper.h | 1 | // Copyright 2011 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/deps_log.h | 1 | // Copyright 2012 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/deps_log.h | 21 | #include <stdio.h> | COMMENT |
| LOW | src/deps_log.h | 41 | /// help guide the design space. The total text in the files sums to | COMMENT |
| LOW | src/gen_doxygen_mainpage.sh | 1 | #!/bin/sh | COMMENT |
| LOW | src/string_piece_util.h | 1 | // Copyright 2017 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/json.h | 1 | // Copyright 2021 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/load_status.h | 1 | // Copyright 2019 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/util.h | 1 | // Copyright 2011 Google Inc. All Rights Reserved. | COMMENT |
| LOW | src/util.h | 21 | #include <stdint.h> | COMMENT |
| LOW | src/util.h | 41 | COMMENT | |
| LOW | src/util.h | 101 | /// @return the load average of the machine. A negative value is returned | COMMENT |
| 34 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | misc/output_test.py | 175 | command = sleep $delay && echo $out | STRING |
| HIGH⚡ | misc/output_test.py | 363 | command = touch $out && echo "$out: extra" > $depfile | CODE |
| HIGH⚡ | misc/output_test.py | 370 | [1/1] touch somewhere/out && echo "somewhere/out: extra" > somewhere_else/out.d | CODE |
| HIGH⚡ | misc/output_test.py | 423 | build out3 : cat out2 out1 | implicit || order_only | CODE |
| HIGH | misc/output_test.py | 635 | build out: touch || dd | CODE |
| HIGH | misc/output_test.py | 687 | build stamp-1: touch || dd-1 | STRING |
| HIGH | misc/output_test.py | 689 | build stamp-2: touch || dd-2 | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | misc/ninja_syntax_test.py | 55 | def test_short_words_indented(self) -> None: | CODE |
| LOW | misc/ninja_syntax_test.py | 67 | def test_few_long_words_indented(self) -> None: | STRING |
| LOW⚡ | misc/ninja_syntax_test.py | 101 | def test_embedded_dollar_dollar(self) -> None: | STRING |
| LOW⚡ | misc/ninja_syntax_test.py | 110 | def test_two_embedded_dollar_dollars(self) -> None: | STRING |
| LOW⚡ | misc/ninja_syntax_test.py | 119 | def test_leading_dollar_dollar(self) -> None: | STRING |
| LOW⚡ | misc/ninja_syntax_test.py | 128 | def test_trailing_dollar_dollar(self) -> None: | STRING |
| LOW | misc/jobserver_test.py | 154 | def generate_double_build_plan( | STRING |
| LOW | misc/jobserver_test.py | 193 | def get_spans_for_multiple_builds(build_dirs: T.List[str], command_counts: T.List[int]) -> T.List[T.Tuple[int, int]]: | STRING |
| LOW | misc/jobserver_test.py | 219 | def compute_max_overlapped_spans(build_dir: str, command_count: int) -> int: | STRING |
| LOW | misc/jobserver_test.py | 328 | def test_jobserver_client_with_posix_fifo(self): | STRING |
| LOW | misc/jobserver_test.py | 332 | def test_jobserver_client_with_posix_pipe(self): | STRING |
| LOW | misc/jobserver_test.py | 347 | def run_ninja_with_jobserver_pipe(args): | STRING |
| LOW | misc/jobserver_test.py | 371 | def test_jobserver_client_with_posix_fifo_token_efficiency(self): | STRING |
| LOW | misc/ninja_syntax.py | 155 | def _count_dollars_before_index(self, s: str, i: int) -> int: | CODE |
| LOW⚡ | misc/output_test.py | 360 | def test_depfile_directory_creation(self) -> None: | STRING |
| LOW⚡ | misc/output_test.py | 380 | def test_ninja_status_default(self) -> None: | STRING |
| LOW⚡ | misc/output_test.py | 395 | def test_status_flag_without_description(self) -> None: | STRING |
| LOW⚡ | misc/output_test.py | 401 | def test_status_flag_description_placement(self) -> None: | STRING |
| LOW⚡ | misc/output_test.py | 407 | def test_status_flag_unknown_variable(self) -> None: | STRING |
| LOW⚡ | misc/output_test.py | 413 | def test_entering_directory_on_stdout(self) -> None: | STRING |
| LOW | tests/compdb/test_compdb_validation.py | 45 | def test_compdb_excludes_validation_edge(self): | CODE |
| LOW | tests/compdb/test_compdb_validation.py | 63 | def test_compdb_with_rule_filter_excludes_validation(self): | STRING |
| LOW | tests/compdb/test_compdb_validation.py | 79 | def test_compdb_keeps_non_validation_edge(self): | STRING |
| LOW | tests/compdb/test_compdb_validation.py | 97 | def test_compdb_targets_excludes_validation_edge(self): | STRING |
| LOW | tests/compdb/test_compdb_validation.py | 113 | def test_compdb_mixed_validation_and_input(self): | STRING |
| LOW | tests/builddir_target/test_builddir_target.py | 48 | def test_exact_match_takes_priority(self): | CODE |
| LOW | tests/builddir_target/test_builddir_target.py | 75 | def test_no_builddir_no_fallback(self): | CODE |
| LOW | tests/builddir_target/test_builddir_target.py | 89 | def test_fallback_with_subdirectory(self): | CODE |
| LOW | tests/builddir_target/test_builddir_target.py | 105 | def test_fallback_miss_still_errors(self): | CODE |
| LOW | tests/restat/test_restat_builddir.py | 30 | def test_restat_with_builddir(self): | CODE |
| LOW | src/browse.py | 166 | class RequestHandler(httpserver.BaseHTTPRequestHandler): | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | configure.py | 39 | CODE | |
| LOW | misc/ninja_syntax.py | 164 | CODE | |
| LOW | misc/jobserver_pool_test.py | 24 | CODE | |
| LOW | misc/jobserver_pool.py | 240 | CODE | |
| LOW | src/browse.py | 69 | CODE | |
| LOW | src/browse.py | 134 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/restat/test_restat_builddir.py | 33 | # Create a simple build.ninja file with builddir | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | configure.py | 387 | except Exception: | CODE |
| LOW | misc/ci.py | 22 | except Exception: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | misc/ninja_syntax.py | 61 | CODE | |
| LOW | tests/builddir_target/test_builddir_target.py | 30 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | misc/jobserver_pool_test.py | 10 | CODE | |
| LOW | misc/jobserver_pool.py | 60 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | misc/jobserver_test.py | 33 | # Set this to True to debug command invocations. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | misc/ninja_syntax.py | 181 | # No such space; just use the first unescaped space we can find. | COMMENT |