Repository Analysis

ninja-build/ninja

a small build system with a focus on speed

14.1 Low AI signal View on GitHub

Analysis Overview

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).

14.1
Adjusted Score
14.1
Raw Score
100%
Time Factor
2026-07-25
Last Push
13.1K
Stars
C++
Language
12.0K
Lines of Code
78
Files
147
Pattern Hits
2026-08-02
Scan Date
0.09
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

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.

No multi-scan history yet — run the scanner again to build trend data.

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 7MEDIUM 1LOW 139

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 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.

Over-Commented Block94 hits · 94 pts
SeverityFileLineSnippetContext
LOWconfigure.py1#!/usr/bin/env python3COMMENT
LOWmisc/ninja_syntax_test.py1#!/usr/bin/env python3COMMENT
LOWmisc/measure.py1#!/usr/bin/env python3COMMENT
LOWmisc/jobserver_test.py1#!/usr/bin/env python3COMMENT
LOWmisc/ninja_syntax.py1#!/usr/bin/pythonCOMMENT
LOWmisc/jobserver_test_helper.py1#!/usr/bin/env python3COMMENT
LOWmisc/jobserver_pool.py1#!/usr/bin/env python3COMMENT
LOWmisc/jobserver_pool.py41#COMMENT
LOWmisc/output_test.py21default_env.pop('NINJA_STATUS', None)COMMENT
LOWmisc/output_test.py41 # [ '\r', 'FOO\x1b[K\r', 'BAR\x1b[K\r', 'ZOO\x1b[K\r\n' ]COMMENT
LOWmisc/oss-fuzz/build.sh1#!/bin/bash -euCOMMENT
LOWsrc/browse.py1#!/usr/bin/env python3COMMENT
LOWsrc/browse.py41except ImportError:COMMENT
LOWsrc/edit_distance.h1// Copyright 2011 Google Inc. All Rights Reserved.COMMENT
LOWsrc/graphviz.h1// Copyright 2011 Google Inc. All Rights Reserved.COMMENT
LOWsrc/manifest_parser.h1// Copyright 2011 Google Inc. All Rights Reserved.COMMENT
LOWsrc/version.h1// Copyright 2013 Google Inc. All Rights Reserved.COMMENT
LOWsrc/status.h1// Copyright 2016 Google Inc. All Rights Reserved.COMMENT
LOWsrc/build_log.h1// Copyright 2011 Google Inc. All Rights Reserved.COMMENT
LOWsrc/build_log.h21#include <string>COMMENT
LOWsrc/hash_map.h1// Copyright 2011 Google Inc. All Rights Reserved.COMMENT
LOWsrc/dyndep_parser.h1// Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWsrc/includes_normalize.h1// Copyright 2012 Google Inc. All Rights Reserved.COMMENT
LOWsrc/clean.h1// Copyright 2011 Google Inc. All Rights Reserved.COMMENT
LOWsrc/clean.h41 int CleanTarget(const char* target);COMMENT
LOWsrc/dyndep.h1// Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWsrc/exit_status.h1// Copyright 2011 Google Inc. All Rights Reserved.COMMENT
LOWsrc/build.h1// Copyright 2011 Google Inc. All Rights Reserved.COMMENT
LOWsrc/build.h121 /// Update plan with knowledge that the given node is up to date.COMMENT
LOWsrc/parser.h1// Copyright 2018 Google Inc. All Rights Reserved.COMMENT
LOWsrc/clparser.h1// Copyright 2015 Google Inc. All Rights Reserved.COMMENT
LOWsrc/clparser.h21/// Visual Studio's cl.exe requires some massaging to work with Ninja;COMMENT
LOWsrc/command_collector.h1// Copyright 2024 Google Inc. All Rights Reserved.COMMENT
LOWsrc/command_collector.h21COMMENT
LOWsrc/depfile_parser.h1// Copyright 2011 Google Inc. All Rights Reserved.COMMENT
LOWsrc/build_result.h1// Copyright 2026 Google Inc. All Rights Reserved.COMMENT
LOWsrc/elide_middle.h1// Copyright 2024 Google Inc. All Rights Reserved.COMMENT
LOWsrc/elide_middle.h21/// Elide the given string @a str with '...' in the middle if the lengthCOMMENT
LOWsrc/test.h1// Copyright 2011 Google Inc. All Rights Reserved.COMMENT
LOWsrc/inline.sh1#!/bin/shCOMMENT
LOWsrc/missing_deps.h1// Copyright 2019 Google Inc. All Rights Reserved.COMMENT
LOWsrc/string_piece.h1// Copyright 2011 Google Inc. All Rights Reserved.COMMENT
LOWsrc/eval_env.h1// Copyright 2011 Google Inc. All Rights Reserved.COMMENT
LOWsrc/graph.h1// Copyright 2011 Google Inc. All Rights Reserved.COMMENT
LOWsrc/graph.h141 /// The path is an actual file. mtime_ will be the file's mtime.COMMENT
LOWsrc/graph.h461COMMENT
LOWsrc/graph.h481/// - Call VisitNode() for each root node to collect inputs from.COMMENT
LOWsrc/status_printer.h1// Copyright 2016 Google Inc. All Rights Reserved.COMMENT
LOWsrc/msvc_helper.h1// Copyright 2011 Google Inc. All Rights Reserved.COMMENT
LOWsrc/deps_log.h1// Copyright 2012 Google Inc. All Rights Reserved.COMMENT
LOWsrc/deps_log.h21#include <stdio.h>COMMENT
LOWsrc/deps_log.h41/// help guide the design space. The total text in the files sums toCOMMENT
LOWsrc/gen_doxygen_mainpage.sh1#!/bin/shCOMMENT
LOWsrc/string_piece_util.h1// Copyright 2017 Google Inc. All Rights Reserved.COMMENT
LOWsrc/json.h1// Copyright 2021 Google Inc. All Rights Reserved.COMMENT
LOWsrc/load_status.h1// Copyright 2019 Google Inc. All Rights Reserved.COMMENT
LOWsrc/util.h1// Copyright 2011 Google Inc. All Rights Reserved.COMMENT
LOWsrc/util.h21#include <stdint.h>COMMENT
LOWsrc/util.h41COMMENT
LOWsrc/util.h101/// @return the load average of the machine. A negative value is returnedCOMMENT
34 more matches not shown…
Cross-Language Confusion7 hits · 35 pts
SeverityFileLineSnippetContext
HIGHmisc/output_test.py175 command = sleep $delay && echo $outSTRING
HIGHmisc/output_test.py363 command = touch $out && echo "$out: extra" > $depfileCODE
HIGHmisc/output_test.py370 [1/1] touch somewhere/out && echo "somewhere/out: extra" > somewhere_else/out.dCODE
HIGHmisc/output_test.py423build out3 : cat out2 out1 | implicit || order_onlyCODE
HIGHmisc/output_test.py635 build out: touch || ddCODE
HIGHmisc/output_test.py687build stamp-1: touch || dd-1STRING
HIGHmisc/output_test.py689build stamp-2: touch || dd-2STRING
Hyper-Verbose Identifiers31 hits · 22 pts
SeverityFileLineSnippetContext
LOWmisc/ninja_syntax_test.py55 def test_short_words_indented(self) -> None:CODE
LOWmisc/ninja_syntax_test.py67 def test_few_long_words_indented(self) -> None:STRING
LOWmisc/ninja_syntax_test.py101 def test_embedded_dollar_dollar(self) -> None:STRING
LOWmisc/ninja_syntax_test.py110 def test_two_embedded_dollar_dollars(self) -> None:STRING
LOWmisc/ninja_syntax_test.py119 def test_leading_dollar_dollar(self) -> None:STRING
LOWmisc/ninja_syntax_test.py128 def test_trailing_dollar_dollar(self) -> None:STRING
LOWmisc/jobserver_test.py154def generate_double_build_plan(STRING
LOWmisc/jobserver_test.py193def get_spans_for_multiple_builds(build_dirs: T.List[str], command_counts: T.List[int]) -> T.List[T.Tuple[int, int]]:STRING
LOWmisc/jobserver_test.py219def compute_max_overlapped_spans(build_dir: str, command_count: int) -> int:STRING
LOWmisc/jobserver_test.py328 def test_jobserver_client_with_posix_fifo(self):STRING
LOWmisc/jobserver_test.py332 def test_jobserver_client_with_posix_pipe(self):STRING
LOWmisc/jobserver_test.py347 def run_ninja_with_jobserver_pipe(args):STRING
LOWmisc/jobserver_test.py371 def test_jobserver_client_with_posix_fifo_token_efficiency(self):STRING
LOWmisc/ninja_syntax.py155 def _count_dollars_before_index(self, s: str, i: int) -> int:CODE
LOWmisc/output_test.py360 def test_depfile_directory_creation(self) -> None:STRING
LOWmisc/output_test.py380 def test_ninja_status_default(self) -> None:STRING
LOWmisc/output_test.py395 def test_status_flag_without_description(self) -> None:STRING
LOWmisc/output_test.py401 def test_status_flag_description_placement(self) -> None:STRING
LOWmisc/output_test.py407 def test_status_flag_unknown_variable(self) -> None:STRING
LOWmisc/output_test.py413 def test_entering_directory_on_stdout(self) -> None:STRING
LOWtests/compdb/test_compdb_validation.py45 def test_compdb_excludes_validation_edge(self):CODE
LOWtests/compdb/test_compdb_validation.py63 def test_compdb_with_rule_filter_excludes_validation(self):STRING
LOWtests/compdb/test_compdb_validation.py79 def test_compdb_keeps_non_validation_edge(self):STRING
LOWtests/compdb/test_compdb_validation.py97 def test_compdb_targets_excludes_validation_edge(self):STRING
LOWtests/compdb/test_compdb_validation.py113 def test_compdb_mixed_validation_and_input(self):STRING
LOWtests/builddir_target/test_builddir_target.py48 def test_exact_match_takes_priority(self):CODE
LOWtests/builddir_target/test_builddir_target.py75 def test_no_builddir_no_fallback(self):CODE
LOWtests/builddir_target/test_builddir_target.py89 def test_fallback_with_subdirectory(self):CODE
LOWtests/builddir_target/test_builddir_target.py105 def test_fallback_miss_still_errors(self):CODE
LOWtests/restat/test_restat_builddir.py30 def test_restat_with_builddir(self):CODE
LOWsrc/browse.py166class RequestHandler(httpserver.BaseHTTPRequestHandler):STRING
Deep Nesting6 hits · 6 pts
SeverityFileLineSnippetContext
LOWconfigure.py39CODE
LOWmisc/ninja_syntax.py164CODE
LOWmisc/jobserver_pool_test.py24CODE
LOWmisc/jobserver_pool.py240CODE
LOWsrc/browse.py69CODE
LOWsrc/browse.py134CODE
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMtests/restat/test_restat_builddir.py33 # Create a simple build.ninja file with builddirCOMMENT
Excessive Try-Catch Wrapping2 hits · 2 pts
SeverityFileLineSnippetContext
LOWconfigure.py387 except Exception:CODE
LOWmisc/ci.py22except Exception:CODE
AI Structural Patterns2 hits · 2 pts
SeverityFileLineSnippetContext
LOWmisc/ninja_syntax.py61CODE
LOWtests/builddir_target/test_builddir_target.py30CODE
Unused Imports2 hits · 2 pts
SeverityFileLineSnippetContext
LOWmisc/jobserver_pool_test.py10CODE
LOWmisc/jobserver_pool.py60CODE
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippetContext
LOWmisc/jobserver_test.py33# Set this to True to debug command invocations.COMMENT
AI Slop Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
LOWmisc/ninja_syntax.py181 # No such space; just use the first unescaped space we can find.COMMENT