Protocol Buffers with small code size
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).
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 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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | pb.h | 81 | * a custom header that defines or includes all this. In that case, | COMMENT |
| LOW | pb.h | 101 | COMMENT | |
| LOW | pb.h | 121 | /* For Microsoft Visual C++ */ | COMMENT |
| LOW | pb.h | 141 | #elif defined(__ICCARM__) || defined(__CC_ARM) | COMMENT |
| LOW | pb.h | 161 | defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM)) \ | COMMENT |
| LOW | pb.h | 201 | # define PB_STATIC_ASSERT(COND,MSG) static_assert(COND,#MSG); | COMMENT |
| LOW | pb.h | 301 | COMMENT | |
| LOW | pb.h | 641 | COMMENT | |
| LOW | pb.h | 661 | #define PB_SO_PB_HTYPE_REQUIRED(structname, fieldname) 0 | COMMENT |
| LOW | pb.h | 681 | COMMENT | |
| LOW | pb.h | 701 | #define PB_DS_PB_HTYPE_REQUIRED(structname, fieldname) pb_membersize(structname, fieldname) | COMMENT |
| LOW | pb.h | 721 | #define PB_ONEOF_NAME_UNION(unionname,membername,fullname) unionname | COMMENT |
| LOW | pb.h | 741 | #define PB_SI_PB_LTYPE_FIXED32(t) | COMMENT |
| LOW | pb.h | 841 | * This is used when PB_BIND() is called with "AUTO" as the argument. | COMMENT |
| LOW | pb.h | 861 | #define PB_FI_WIDTH_PB_LTYPE_FIXED64 1 | COMMENT |
| LOW | pb.h | 881 | #define PB_LTYPE_MAP_ENUM PB_LTYPE_VARINT | COMMENT |
| LOW | pb.h | 921 | COMMENT | |
| LOW | spm-test/objc/objc-qualified.m | 1 | #import "nanopb/pb.h" | COMMENT |
| LOW | spm-test/objc/c-header.c | 1 | #include "pb.h" | COMMENT |
| LOW | spm-test/objc/objc-header.m | 1 | #import "pb.h" | COMMENT |
| LOW | tests/without_64bit/no_64bit_syshdr.h | 1 | /* This wrapper undefines (u)int64_t */ | COMMENT |
| LOW | tests/fuzztest/fuzztest.c | 1 | /* Fuzz testing for the nanopb core. | COMMENT |
| LOW | tests/fuzztest/fuzztest.c | 21 | #include "alltypes_static.pb.h" | COMMENT |
| LOW | tests/fuzztest/generate_message.c | 1 | /* Generates a random, valid protobuf message. Useful to seed | COMMENT |
| LOW | tests/common/test_helpers.h | 1 | /* Compatibility helpers for the test programs. */ | COMMENT |
| LOW | tests/common/malloc_wrappers_syshdr.h | 1 | /* This is just a wrapper in order to get our own malloc wrappers into nanopb core. */ | COMMENT |
| LOW | tests/backwards_compatibility/alltypes_legacy.h | 161 | COMMENT | |
| LOW | tests/backwards_compatibility/alltypes_legacy.h | 181 | #define Limits_enum_min_tag 9 | COMMENT |
| LOW | tests/backwards_compatibility/alltypes_legacy.h | 201 | #define AllTypes_req_submsg_tag 16 | COMMENT |
| LOW | tests/backwards_compatibility/alltypes_legacy.h | 221 | #define AllTypes_opt_int64_tag 42 | COMMENT |
| LOW | tests/site_scons/platforms/avr/run_test.c | 1 | #include <unistd.h> | COMMENT |
| LOW | generator/nanopb_generator.py | 1061 | # another file. Instead of including the symbols directly, | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 81 | * a custom header that defines or includes all this. In that case, | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 101 | COMMENT | |
| LOW | spm_headers/nanopb/pb.h | 121 | /* For Microsoft Visual C++ */ | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 141 | #elif defined(__ICCARM__) || defined(__CC_ARM) | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 161 | defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM)) \ | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 201 | # define PB_STATIC_ASSERT(COND,MSG) static_assert(COND,#MSG); | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 301 | COMMENT | |
| LOW | spm_headers/nanopb/pb.h | 641 | COMMENT | |
| LOW | spm_headers/nanopb/pb.h | 661 | #define PB_SO_PB_HTYPE_REQUIRED(structname, fieldname) 0 | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 681 | COMMENT | |
| LOW | spm_headers/nanopb/pb.h | 701 | #define PB_DS_PB_HTYPE_REQUIRED(structname, fieldname) pb_membersize(structname, fieldname) | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 721 | #define PB_ONEOF_NAME_UNION(unionname,membername,fullname) unionname | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 741 | #define PB_SI_PB_LTYPE_FIXED32(t) | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 841 | * This is used when PB_BIND() is called with "AUTO" as the argument. | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 861 | #define PB_FI_WIDTH_PB_LTYPE_FIXED64 1 | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 881 | #define PB_LTYPE_MAP_ENUM PB_LTYPE_VARINT | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 921 | COMMENT | |
| LOW | extra/pb_syshdr.h | 41 | COMMENT | |
| LOW | .github/workflows/codeql.yml | 1 | # For most projects, this workflow file will not need changing; you simply need | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | generator/nanopb_generator.py | 1330 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | generator/nanopb_generator.py | 1332 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | generator/nanopb_generator.py | 2387 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | generator/nanopb_generator.py | 2389 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | generator/nanopb_generator.py | 1211 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | generator/nanopb_generator.py | 1213 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | generator/nanopb_generator.py | 1748 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | generator/nanopb_generator.py | 1750 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | generator/nanopb_generator.py | 2498 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | generator/nanopb_generator.py | 2500 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | generator/nanopb_generator.py | 72 | # --------------------------------------------------------------------------- | STRING |
| MEDIUM | generator/nanopb_generator.py | 74 | # --------------------------------------------------------------------------- | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/site_scons/site_init.py | 30 | CODE | |
| LOW | tests/site_scons/site_init.py | 105 | CODE | |
| LOW | generator/nanopb_generator.py | 1783 | CODE | |
| LOW | generator/nanopb_generator.py | 2460 | CODE | |
| LOW | generator/nanopb_generator.py | 2679 | CODE | |
| LOW | generator/nanopb_generator.py | 2738 | CODE | |
| LOW | generator/nanopb_generator.py | 602 | CODE | |
| LOW | generator/nanopb_generator.py | 793 | CODE | |
| LOW | generator/nanopb_generator.py | 856 | CODE | |
| LOW | generator/nanopb_generator.py | 992 | CODE | |
| LOW | generator/nanopb_generator.py | 1041 | CODE | |
| LOW | generator/nanopb_generator.py | 1290 | CODE | |
| LOW | generator/nanopb_generator.py | 1361 | CODE | |
| LOW | generator/nanopb_generator.py | 1670 | CODE | |
| LOW | generator/nanopb_generator.py | 1873 | CODE | |
| LOW | generator/nanopb_generator.py | 2043 | CODE | |
| LOW | generator/nanopb_generator.py | 2078 | CODE | |
| LOW | .github/workflows/fail_on_error.py | 7 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | generator/nanopb_generator.py | 694 | # Check if the field can be implemented with static allocation | COMMENT |
| LOW | generator/nanopb_generator.py | 2275 | # Check if there is any name mangling active | COMMENT |
| LOW | generator/nanopb_generator.py | 2324 | # Check if any messages exceed the 64 kB limit of 16-bit pb_size_t | COMMENT |
| LOW | generator/nanopb_generator.py | 2644 | # Check if there is a separate .options file | COMMENT |
| LOW | generator/nanopb_generator.py | 2722 | # Check if there were any lines in .options that did not match a member | COMMENT |
| LOW | generator/nanopb_generator.py | 2883 | # Check if we are running as a plugin under protoc | COMMENT |
| LOW | generator/platformio_generator.py | 35 | # Check if 'custom_nanopb_project_dir' is defined, else default to $PROJECT_DIR | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/regression/issue_954/test_options_diagnostics.py | 48 | def expect_comment_markers_in_strings(): | CODE |
| LOW⚡ | generator/nanopb_generator.py | 1327 | def requires_custom_field_callback(self): | CODE |
| LOW⚡ | generator/nanopb_generator.py | 2393 | def validate_options_namemask(namemask, filename, line_number): | CODE |
| LOW | generator/nanopb_generator.py | 536 | def enum_to_string_definition(self): | CODE |
| LOW | generator/nanopb_generator.py | 1118 | def requires_custom_field_callback(self): | CODE |
| LOW | generator/nanopb_generator.py | 1144 | def requires_custom_field_callback(self): | CODE |
| LOW | generator/nanopb_generator.py | 1590 | def fields_declaration_cpp_lookup(self, local_defines): | CODE |
| LOW | generator/nanopb_generator.py | 1626 | def required_descriptor_width(self, dependencies): | CODE |
| LOW | generator/nanopb_generator.py | 1783 | def check_recursive_dependencies(message, all_messages, root = None): | CODE |
| LOW | generator/nanopb_generator.py | 2021 | def discard_unused_automatic_types(self): | CODE |
| LOW | .github/workflows/fail_on_error.py | 7 | def codeql_sarif_contain_error(filename): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | conanfile.py | 1 | CODE | |
| LOW | tests/site_scons/site_tools/nanopb.py | 34 | CODE | |
| LOW | tests/site_scons/site_tools/nanopb.py | 36 | CODE | |
| LOW | generator/nanopb_generator.py | 4 | CODE | |
| LOW | generator/nanopb_generator.py | 14 | CODE | |
| LOW | generator/nanopb_generator.py | 15 | CODE | |
| LOW | generator/nanopb_generator.py | 18 | CODE | |
| LOW | generator/platformio_generator.py | 18 | CODE | |
| LOW | generator/platformio_generator.py | 27 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | generator/nanopb_generator.py | 519 | # Define the long names always so that enum value references | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | generator/nanopb_generator.py | 1062 | # just use the #define SubMessage_size from the header. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | generator/nanopb_generator.py | 2451 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | generator/nanopb_generator.py | 1624 | CODE |