Repository Analysis

nlohmann/json

JSON for Modern C++

2.9 Likely human-written View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of nlohmann/json, a C++ project with 50,118 GitHub stars. SynthScan v2.0 examined 158,924 lines of code across 862 source files, recording 557 pattern matches distributed across 7 syntactic categories. The overall adjusted score of 2.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).

2.9
Adjusted Score
2.9
Raw Score
100%
Time Factor
2026-07-12
Last Push
50.1K
Stars
C++
Language
158.9K
Lines of Code
862
Files
557
Pattern Hits
2026-07-14
Scan Date
0.00
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 1HIGH 0MEDIUM 0LOW 556

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 557 distinct pattern matches across 7 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 Block528 hits · 422 pts
SeverityFileLineSnippetContext
LOWCMakeLists.txt1cmake_minimum_required(VERSION 3.5...4.0)COMMENT
LOWREADME.md681// apply the patchCOMMENT
LOWtools/amalgamate/amalgamate.py1#!/usr/bin/env python3COMMENT
LOWinclude/nlohmann/ordered_map.hpp1// __ _____ _____ _____COMMENT
LOWinclude/nlohmann/ordered_map.hpp241COMMENT
LOWinclude/nlohmann/json.hpp21// Workaround for GCC template redefinition errors in C++ modulesCOMMENT
LOWinclude/nlohmann/json.hpp41#include <utility> // declval, forward, move, pair, swapCOMMENT
LOWinclude/nlohmann/json.hpp61#include <nlohmann/detail/json_ref.hpp>COMMENT
LOWinclude/nlohmann/json.hpp341 }COMMENT
LOWinclude/nlohmann/json.hpp801 // ordered_json uses a vector internally, so pointers could haveCOMMENT
LOWinclude/nlohmann/json.hpp3841 requires std::is_scalar_v<ScalarType>COMMENT
LOWinclude/nlohmann/json.hpp4021COMMENT
LOWinclude/nlohmann/json.hpp5461COMMENT
LOWinclude/nlohmann/adl_serializer.hpp1// __ _____ _____ _____COMMENT
LOWinclude/nlohmann/byte_container_with_subtype.hpp1// __ _____ _____ _____COMMENT
LOWinclude/nlohmann/json_fwd.hpp1// __ _____ _____ _____COMMENT
LOWinclude/nlohmann/detail/hash.hpp1// __ _____ _____ _____COMMENT
LOWinclude/nlohmann/detail/json_ref.hpp1// __ _____ _____ _____COMMENT
LOWinclude/nlohmann/detail/value_t.hpp1// __ _____ _____ _____COMMENT
LOWinclude/nlohmann/detail/string_concat.hpp1// __ _____ _____ _____COMMENT
LOWinclude/nlohmann/detail/string_utils.hpp1// __ _____ _____ _____COMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp1// __ _____ _____ _____COMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp21#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK)COMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp41 #define JSON_HAS_CPP_14COMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp61#ifdef __has_includeCOMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp81 // std::filesystem does not work on MinGW GCC 8: https://sourceforge.net/p/mingw-w64/bugs/737/COMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp101 #undef JSON_HAS_FILESYSTEMCOMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp121#endifCOMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp141 #elif defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE < 11COMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp161#ifndef JSON_HAS_STD_FORMATCOMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp181#endifCOMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp201 #define JSON_INTERNAL_CATCH(exception) catch(exception)COMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp221 #define JSON_CATCH JSON_CATCH_USERCOMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp421#define NLOHMANN_JSON_PASTE3(func, v1, v2) NLOHMANN_JSON_PASTE2(func, v1) NLOHMANN_JSON_PASTE2(func, v2)COMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp441#define NLOHMANN_JSON_PASTE23(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19COMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp461#define NLOHMANN_JSON_PASTE43(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19COMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp541 NLOHMANN_JSON_DOUBLE_PASTE7, \COMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp561#define NLOHMANN_JSON_DOUBLE_PASTE29(func, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, vCOMMENT
LOWinclude/nlohmann/detail/macro_scope.hpp801#endifCOMMENT
LOWinclude/nlohmann/detail/json_pointer.hpp1// __ _____ _____ _____COMMENT
LOWinclude/nlohmann/detail/exceptions.hpp1// __ _____ _____ _____COMMENT
LOWinclude/nlohmann/detail/exceptions.hpp21#include <nlohmann/detail/string_escape.hpp>COMMENT
LOWinclude/nlohmann/detail/abi_macros.hpp1// __ _____ _____ _____COMMENT
LOWinclude/nlohmann/detail/abi_macros.hpp21#define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum)COMMENT
LOWinclude/nlohmann/detail/abi_macros.hpp41#endifCOMMENT
LOWinclude/nlohmann/detail/macro_unscope.hpp1// __ _____ _____ _____COMMENT
LOWinclude/nlohmann/detail/macro_unscope.hpp21#undef NLOHMANN_BASIC_JSON_TPL_DECLARATIONCOMMENT
LOWinclude/nlohmann/detail/macro_unscope.hpp41 #undef JSON_HAS_EXPERIMENTAL_FILESYSTEMCOMMENT
LOWinclude/nlohmann/detail/conversions/to_chars.hpp1// __ _____ _____ _____COMMENT
LOWinclude/nlohmann/detail/conversions/to_chars.hpp81 */COMMENT
LOWinclude/nlohmann/detail/conversions/to_chars.hpp221 // v = f * 2^e.COMMENT
LOWinclude/nlohmann/detail/conversions/to_chars.hpp261//COMMENT
LOWinclude/nlohmann/detail/conversions/to_chars.hpp281//COMMENT
LOWinclude/nlohmann/detail/conversions/to_chars.hpp321/*!COMMENT
LOWinclude/nlohmann/detail/conversions/to_chars.hpp341 //COMMENT
LOWinclude/nlohmann/detail/conversions/to_chars.hpp361 // e <= +1023 (max IEEE exponent)COMMENT
LOWinclude/nlohmann/detail/conversions/to_chars.hpp621 std::uint64_t p2 = M_plus.f & (one.f - 1); // p2 = f mod 2^-eCOMMENT
LOWinclude/nlohmann/detail/conversions/to_chars.hpp641 //COMMENT
LOWinclude/nlohmann/detail/conversions/to_chars.hpp661 // = (buffer * 10 + d) * 10^(n-1) + (r + p2 * 2^e)COMMENT
LOWinclude/nlohmann/detail/conversions/to_chars.hpp681 // Since rest and delta share the same exponent e, it suffices toCOMMENT
468 more matches not shown…
Fake / Example Data13 hits · 13 pts
SeverityFileLineSnippetContext
LOWtests/src/unit-conversions.cpp1797 std::optional<std::string> opt_get_to = "placeholder";CODE
LOWtests/src/unit-udt.cpp435 optPerson.reset(new udt::person{{42}, {"John Doe"}, udt::country::russia}); // NOLINT(cppcoreguidelines-owniCODE
LOWtests/src/unit-udt.cpp444 auto person = udt::person{{42}, {"John Doe"}, udt::country::russia};CODE
LOWtests/src/unit-udt.cpp548 optPerson.reset(new udt::person{{42}, {"John Doe"}, udt::country::russia}); // NOLINT(cppcoreguidelines-owning-mCODE
LOWtests/src/unit-udt.cpp557 auto person = udt::person{{42}, {"John Doe"}, udt::country::russia};CODE
LOW…mann_define_type_intrusive_only_serialize_explicit.cpp12 std::string name = "John Doe";CODE
LOW…s/examples/nlohmann_define_type_intrusive_explicit.cpp12 std::string name = "John Doe";CODE
LOW…ohmann_define_type_intrusive_with_default_explicit.cpp12 std::string name = "John Doe";CODE
LOW…nn_define_type_non_intrusive_with_default_explicit.cpp11 std::string name = "John Doe";CODE
LOW…hmann_define_type_non_intrusive_with_default_macro.cpp11 std::string name = "John Doe";CODE
LOW…docs/examples/nlohmann_define_type_intrusive_macro.cpp12 std::string name = "John Doe";CODE
LOW…lohmann_define_type_intrusive_only_serialize_macro.cpp12 std::string name = "John Doe";CODE
LOW…/nlohmann_define_type_intrusive_with_default_macro.cpp12 std::string name = "John Doe";CODE
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippetContext
CRITICAL.github/workflows/comment_check_amalgamation.yml74 const opts = github.rest.issues.listForRepo.endpoint.merge({CODE
Deep Nesting9 hits · 9 pts
SeverityFileLineSnippetContext
LOWtools/serve_header/serve_header.py160CODE
LOWtools/serve_header/serve_header.py195CODE
LOWtools/serve_header/serve_header.py223CODE
LOWtools/amalgamate/amalgamate.py144CODE
LOWtools/gdb_pretty_printer/nlohmann-json.py16CODE
LOWtests/thirdparty/imapdl/filterbr.py8CODE
LOWtests/thirdparty/imapdl/filterbr.py37CODE
LOWtests/thirdparty/imapdl/filterbr.py84CODE
LOWdocs/mkdocs/scripts/check_structure.py19CODE
Unused Imports3 hits · 3 pts
SeverityFileLineSnippetContext
LOWtools/amalgamate/amalgamate.py32CODE
LOWtools/amalgamate/amalgamate.py33CODE
LOWtools/amalgamate/amalgamate.py34CODE
Excessive Try-Catch Wrapping2 hits · 2 pts
SeverityFileLineSnippetContext
LOWtools/serve_header/serve_header.py410 except Exception:CODE
LOWtools/gdb_pretty_printer/nlohmann-json.py32 except Exception:CODE
Hyper-Verbose Identifiers1 hit · 1 pts
SeverityFileLineSnippetContext
LOWtools/serve_header/serve_header.py249class HeaderRequestHandler(SimpleHTTPRequestHandler): # lgtm[py/missing-call-to-init]CODE