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,541 GitHub stars. SynthScan v2.0 examined 30,383 lines of code across 255 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-08-26
Last Push
5.5K
Stars
C
Language
30.4K
Lines of Code
255
Files
112
Pattern Hits
2026-08-29
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 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 Block49 hits · 48 pts
SeverityFileLineSnippetContext
LOWpb.h81 * - boolCOMMENT
LOWpb.h101#ifdef __cplusplusCOMMENT
LOWpb.h121# define PB_PACKED_STRUCT_END _Pragma("pack(pop)")COMMENT
LOWpb.h141# elseCOMMENT
LOWpb.h201# define PB_STATIC_ASSERT(COND,MSG) static_assert(COND,#MSG);COMMENT
LOWpb.h641 PB_DATA_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \COMMENT
LOWpb.h661#define PB_SIZE_OFFSET_STATIC(htype, structname, fieldname) PB_SO ## htype(structname, fieldname)COMMENT
LOWpb.h681#define PB_SO_CB_PB_HTYPE_OPTIONAL(structname, fieldname) 0COMMENT
LOWpb.h701#define PB_DATA_SIZE_STATIC(htype, structname, fieldname) PB_DS ## htype(structname, fieldname)COMMENT
LOWpb.h721#define PB_DS_CB_PB_HTYPE_FIXARRAY(structname, fieldname) pb_membersize(structname, fieldname)COMMENT
LOWpb.h741#define PB_SI_PB_LTYPE_DOUBLE(t)COMMENT
LOWpb.h841COMMENT
LOWpb.h861#define PB_FI_WIDTH_PB_LTYPE_ENUM 1COMMENT
LOWpb.h881#define PB_LTYPE_MAP_BOOL PB_LTYPE_BOOLCOMMENT
LOWpb.h921#endifCOMMENT
LOWpb_decode.h61};COMMENT
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 "test_helpers.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 * - boolCOMMENT
LOWspm_headers/nanopb/pb.h101#ifdef __cplusplusCOMMENT
LOWspm_headers/nanopb/pb.h121# define PB_PACKED_STRUCT_END _Pragma("pack(pop)")COMMENT
LOWspm_headers/nanopb/pb.h141# elseCOMMENT
LOWspm_headers/nanopb/pb.h201# define PB_STATIC_ASSERT(COND,MSG) static_assert(COND,#MSG);COMMENT
LOWspm_headers/nanopb/pb.h641 PB_DATA_SIZE_ ## atype(_PB_HTYPE_ ## htype, structname, fieldname), \COMMENT
LOWspm_headers/nanopb/pb.h661#define PB_SIZE_OFFSET_STATIC(htype, structname, fieldname) PB_SO ## htype(structname, fieldname)COMMENT
LOWspm_headers/nanopb/pb.h681#define PB_SO_CB_PB_HTYPE_OPTIONAL(structname, fieldname) 0COMMENT
LOWspm_headers/nanopb/pb.h701#define PB_DATA_SIZE_STATIC(htype, structname, fieldname) PB_DS ## htype(structname, fieldname)COMMENT
LOWspm_headers/nanopb/pb.h721#define PB_DS_CB_PB_HTYPE_FIXARRAY(structname, fieldname) pb_membersize(structname, fieldname)COMMENT
LOWspm_headers/nanopb/pb.h741#define PB_SI_PB_LTYPE_DOUBLE(t)COMMENT
LOWspm_headers/nanopb/pb.h841COMMENT
LOWspm_headers/nanopb/pb.h861#define PB_FI_WIDTH_PB_LTYPE_ENUM 1COMMENT
LOWspm_headers/nanopb/pb.h881#define PB_LTYPE_MAP_BOOL PB_LTYPE_BOOLCOMMENT
LOWspm_headers/nanopb/pb.h921#endifCOMMENT
LOWspm_headers/nanopb/pb_decode.h61};COMMENT
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
Hyper-Verbose Identifiers13 hits · 10 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
LOWbuild-tests/platformio/test_platformio_generator.py104 def test_options_cache_tracks_create_modify_and_delete(self):CODE
LOWbuild-tests/platformio/test_platformio_generator.py138 def test_failed_regeneration_keeps_deleted_options_marker(self):CODE
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
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