Repository Analysis

nanopb/nanopb

Protocol Buffers with small code size

4.3 Likely human-written View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of nanopb/nanopb, a C project with 5,479 GitHub stars. SynthScan v2.0 examined 29,824 lines of code across 249 source files, recording 112 pattern matches distributed across 10 syntactic categories. The overall adjusted score of 4.3 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).

4.3
Adjusted Score
4.3
Raw Score
100%
Time Factor
2026-07-12
Last Push
5.5K
Stars
C
Language
29.8K
Lines of Code
249
Files
112
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

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 0MEDIUM 13LOW 99

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 112 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 Block51 hits · 50 pts
SeverityFileLineSnippetContext
LOWpb.h81 * a custom header that defines or includes all this. In that case,COMMENT
LOWpb.h101COMMENT
LOWpb.h121 /* For Microsoft Visual C++ */COMMENT
LOWpb.h141#elif defined(__ICCARM__) || defined(__CC_ARM)COMMENT
LOWpb.h161 defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM)) \COMMENT
LOWpb.h201# define PB_STATIC_ASSERT(COND,MSG) static_assert(COND,#MSG);COMMENT
LOWpb.h301COMMENT
LOWpb.h641COMMENT
LOWpb.h661#define PB_SO_PB_HTYPE_REQUIRED(structname, fieldname) 0COMMENT
LOWpb.h681COMMENT
LOWpb.h701#define PB_DS_PB_HTYPE_REQUIRED(structname, fieldname) pb_membersize(structname, fieldname)COMMENT
LOWpb.h721#define PB_ONEOF_NAME_UNION(unionname,membername,fullname) unionnameCOMMENT
LOWpb.h741#define PB_SI_PB_LTYPE_FIXED32(t)COMMENT
LOWpb.h841 * This is used when PB_BIND() is called with "AUTO" as the argument.COMMENT
LOWpb.h861#define PB_FI_WIDTH_PB_LTYPE_FIXED64 1COMMENT
LOWpb.h881#define PB_LTYPE_MAP_ENUM PB_LTYPE_VARINTCOMMENT
LOWpb.h921COMMENT
LOWspm-test/objc/objc-qualified.m1#import "nanopb/pb.h"COMMENT
LOWspm-test/objc/c-header.c1#include "pb.h"COMMENT
LOWspm-test/objc/objc-header.m1#import "pb.h"COMMENT
LOWtests/without_64bit/no_64bit_syshdr.h1/* This wrapper undefines (u)int64_t */COMMENT
LOWtests/fuzztest/fuzztest.c1/* Fuzz testing for the nanopb core.COMMENT
LOWtests/fuzztest/fuzztest.c21#include "alltypes_static.pb.h"COMMENT
LOWtests/fuzztest/generate_message.c1/* Generates a random, valid protobuf message. Useful to seedCOMMENT
LOWtests/common/test_helpers.h1/* Compatibility helpers for the test programs. */COMMENT
LOWtests/common/malloc_wrappers_syshdr.h1/* This is just a wrapper in order to get our own malloc wrappers into nanopb core. */COMMENT
LOWtests/backwards_compatibility/alltypes_legacy.h161COMMENT
LOWtests/backwards_compatibility/alltypes_legacy.h181#define Limits_enum_min_tag 9COMMENT
LOWtests/backwards_compatibility/alltypes_legacy.h201#define AllTypes_req_submsg_tag 16COMMENT
LOWtests/backwards_compatibility/alltypes_legacy.h221#define AllTypes_opt_int64_tag 42COMMENT
LOWtests/site_scons/platforms/avr/run_test.c1#include <unistd.h>COMMENT
LOWgenerator/nanopb_generator.py1061 # another file. Instead of including the symbols directly,COMMENT
LOWspm_headers/nanopb/pb.h81 * a custom header that defines or includes all this. In that case,COMMENT
LOWspm_headers/nanopb/pb.h101COMMENT
LOWspm_headers/nanopb/pb.h121 /* For Microsoft Visual C++ */COMMENT
LOWspm_headers/nanopb/pb.h141#elif defined(__ICCARM__) || defined(__CC_ARM)COMMENT
LOWspm_headers/nanopb/pb.h161 defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM)) \COMMENT
LOWspm_headers/nanopb/pb.h201# define PB_STATIC_ASSERT(COND,MSG) static_assert(COND,#MSG);COMMENT
LOWspm_headers/nanopb/pb.h301COMMENT
LOWspm_headers/nanopb/pb.h641COMMENT
LOWspm_headers/nanopb/pb.h661#define PB_SO_PB_HTYPE_REQUIRED(structname, fieldname) 0COMMENT
LOWspm_headers/nanopb/pb.h681COMMENT
LOWspm_headers/nanopb/pb.h701#define PB_DS_PB_HTYPE_REQUIRED(structname, fieldname) pb_membersize(structname, fieldname)COMMENT
LOWspm_headers/nanopb/pb.h721#define PB_ONEOF_NAME_UNION(unionname,membername,fullname) unionnameCOMMENT
LOWspm_headers/nanopb/pb.h741#define PB_SI_PB_LTYPE_FIXED32(t)COMMENT
LOWspm_headers/nanopb/pb.h841 * This is used when PB_BIND() is called with "AUTO" as the argument.COMMENT
LOWspm_headers/nanopb/pb.h861#define PB_FI_WIDTH_PB_LTYPE_FIXED64 1COMMENT
LOWspm_headers/nanopb/pb.h881#define PB_LTYPE_MAP_ENUM PB_LTYPE_VARINTCOMMENT
LOWspm_headers/nanopb/pb.h921COMMENT
LOWextra/pb_syshdr.h41COMMENT
LOW.github/workflows/codeql.yml1# For most projects, this workflow file will not need changing; you simply needCOMMENT
Decorative Section Separators12 hits · 37 pts
SeverityFileLineSnippetContext
MEDIUMgenerator/nanopb_generator.py1330# ---------------------------------------------------------------------------COMMENT
MEDIUMgenerator/nanopb_generator.py1332# ---------------------------------------------------------------------------COMMENT
MEDIUMgenerator/nanopb_generator.py2387# ---------------------------------------------------------------------------COMMENT
MEDIUMgenerator/nanopb_generator.py2389# ---------------------------------------------------------------------------COMMENT
MEDIUMgenerator/nanopb_generator.py1211# ---------------------------------------------------------------------------COMMENT
MEDIUMgenerator/nanopb_generator.py1213# ---------------------------------------------------------------------------COMMENT
MEDIUMgenerator/nanopb_generator.py1748# ---------------------------------------------------------------------------COMMENT
MEDIUMgenerator/nanopb_generator.py1750# ---------------------------------------------------------------------------COMMENT
MEDIUMgenerator/nanopb_generator.py2498# ---------------------------------------------------------------------------COMMENT
MEDIUMgenerator/nanopb_generator.py2500# ---------------------------------------------------------------------------COMMENT
MEDIUMgenerator/nanopb_generator.py72# ---------------------------------------------------------------------------STRING
MEDIUMgenerator/nanopb_generator.py74# ---------------------------------------------------------------------------STRING
Deep Nesting18 hits · 10 pts
SeverityFileLineSnippetContext
LOWtests/site_scons/site_init.py30CODE
LOWtests/site_scons/site_init.py105CODE
LOWgenerator/nanopb_generator.py1783CODE
LOWgenerator/nanopb_generator.py2460CODE
LOWgenerator/nanopb_generator.py2679CODE
LOWgenerator/nanopb_generator.py2738CODE
LOWgenerator/nanopb_generator.py602CODE
LOWgenerator/nanopb_generator.py793CODE
LOWgenerator/nanopb_generator.py856CODE
LOWgenerator/nanopb_generator.py992CODE
LOWgenerator/nanopb_generator.py1041CODE
LOWgenerator/nanopb_generator.py1290CODE
LOWgenerator/nanopb_generator.py1361CODE
LOWgenerator/nanopb_generator.py1670CODE
LOWgenerator/nanopb_generator.py1873CODE
LOWgenerator/nanopb_generator.py2043CODE
LOWgenerator/nanopb_generator.py2078CODE
LOW.github/workflows/fail_on_error.py7CODE
Redundant / Tautological Comments7 hits · 10 pts
SeverityFileLineSnippetContext
LOWgenerator/nanopb_generator.py694 # Check if the field can be implemented with static allocationCOMMENT
LOWgenerator/nanopb_generator.py2275 # Check if there is any name mangling activeCOMMENT
LOWgenerator/nanopb_generator.py2324 # Check if any messages exceed the 64 kB limit of 16-bit pb_size_tCOMMENT
LOWgenerator/nanopb_generator.py2644 # Check if there is a separate .options fileCOMMENT
LOWgenerator/nanopb_generator.py2722 # Check if there were any lines in .options that did not match a memberCOMMENT
LOWgenerator/nanopb_generator.py2883 # Check if we are running as a plugin under protocCOMMENT
LOWgenerator/platformio_generator.py35# Check if 'custom_nanopb_project_dir' is defined, else default to $PROJECT_DIRCOMMENT
Hyper-Verbose Identifiers11 hits · 8 pts
SeverityFileLineSnippetContext
LOWtests/regression/issue_954/test_options_diagnostics.py48def expect_comment_markers_in_strings():CODE
LOWgenerator/nanopb_generator.py1327 def requires_custom_field_callback(self):CODE
LOWgenerator/nanopb_generator.py2393def validate_options_namemask(namemask, filename, line_number):CODE
LOWgenerator/nanopb_generator.py536 def enum_to_string_definition(self):CODE
LOWgenerator/nanopb_generator.py1118 def requires_custom_field_callback(self):CODE
LOWgenerator/nanopb_generator.py1144 def requires_custom_field_callback(self):CODE
LOWgenerator/nanopb_generator.py1590 def fields_declaration_cpp_lookup(self, local_defines):CODE
LOWgenerator/nanopb_generator.py1626 def required_descriptor_width(self, dependencies):CODE
LOWgenerator/nanopb_generator.py1783def check_recursive_dependencies(message, all_messages, root = None):CODE
LOWgenerator/nanopb_generator.py2021 def discard_unused_automatic_types(self):CODE
LOW.github/workflows/fail_on_error.py7def codeql_sarif_contain_error(filename):CODE
Unused Imports9 hits · 7 pts
SeverityFileLineSnippetContext
LOWconanfile.py1CODE
LOWtests/site_scons/site_tools/nanopb.py34CODE
LOWtests/site_scons/site_tools/nanopb.py36CODE
LOWgenerator/nanopb_generator.py4CODE
LOWgenerator/nanopb_generator.py14CODE
LOWgenerator/nanopb_generator.py15CODE
LOWgenerator/nanopb_generator.py18CODE
LOWgenerator/platformio_generator.py18CODE
LOWgenerator/platformio_generator.py27CODE
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMgenerator/nanopb_generator.py519 # Define the long names always so that enum value referencesCOMMENT
AI Slop Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
LOWgenerator/nanopb_generator.py1062 # just use the #define SubMessage_size from the header.COMMENT
Excessive Try-Catch Wrapping1 hit · 0 pts
SeverityFileLineSnippetContext
LOWgenerator/nanopb_generator.py2451 except Exception as e:CODE
AI Structural Patterns1 hit · 0 pts
SeverityFileLineSnippetContext
LOWgenerator/nanopb_generator.py1624CODE