Protocol Buffers with small code size
This report summarizes scanner evidence for nanopb/nanopb, a C project with 5,577 GitHub stars. SynthScan examined 30,556 lines of code across 258 source files, recording 112 pattern matches distributed across 11 syntactic categories. The legacy adjusted pattern signal is 4.8 (Low pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 86 finding(s).
Are imports declared and package/API names verified? 9 finding(s).
Are wrappers, guards, and repeated structures necessary? 31 finding(s).
Which changes need focused human review? 112 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 112 distinct pattern matches across 11 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | pb.h | 81 | * - bool | COMMENT |
| LOW | pb.h | 101 | #ifdef __cplusplus | COMMENT |
| LOW | pb.h | 121 | # define PB_PACKED_STRUCT_END _Pragma("pack(pop)") | COMMENT |
| LOW | pb.h | 141 | # else | COMMENT |
| LOW | pb.h | 201 | # define PB_STATIC_ASSERT(COND,MSG) static_assert(COND,#MSG); | COMMENT |
| LOW | pb.h | 661 | #define PB_DO_PB_HTYPE_REQUIRED(structname, fieldname) offsetof(structname, fieldname) | COMMENT |
| LOW | pb.h | 681 | #define PB_SO_PTR_PB_HTYPE_ONEOF(structname, fieldname) PB_SO_PB_HTYPE_ONEOF(structname, fieldname) | COMMENT |
| LOW | pb.h | 701 | #define PB_AS_PTR_PB_HTYPE_REQUIRED(structname, fieldname) 1 | COMMENT |
| LOW | pb.h | 721 | #define PB_DS_PTR_PB_HTYPE_REPEATED(structname, fieldname) pb_membersize(structname, fieldname[0]) | COMMENT |
| LOW | pb.h | 741 | #define PB_SUBMSG_INFO_ONEOF(ltype, structname, fieldname) PB_SUBMSG_INFO_ONEOF2(ltype, structname, PB_ONEOF_NAME(UNION, | COMMENT |
| LOW | pb.h | 861 | #define PB_FI_WIDTH_PB_HTYPE_OPTIONAL(ltype) PB_FI_WIDTH ## ltype | COMMENT |
| LOW | pb.h | 881 | #define PB_FI_WIDTH_PB_LTYPE_STRING 2 | COMMENT |
| LOW | pb.h | 921 | */ | COMMENT |
| LOW | pb_decode.h | 61 | }; | 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 "test_helpers.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 | if encsize and encsize.symbols and external: | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 81 | * - bool | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 101 | #ifdef __cplusplus | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 121 | # define PB_PACKED_STRUCT_END _Pragma("pack(pop)") | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 141 | # else | 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 | 661 | #define PB_DO_PB_HTYPE_REQUIRED(structname, fieldname) offsetof(structname, fieldname) | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 681 | #define PB_SO_PTR_PB_HTYPE_ONEOF(structname, fieldname) PB_SO_PB_HTYPE_ONEOF(structname, fieldname) | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 701 | #define PB_AS_PTR_PB_HTYPE_REQUIRED(structname, fieldname) 1 | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 721 | #define PB_DS_PTR_PB_HTYPE_REPEATED(structname, fieldname) pb_membersize(structname, fieldname[0]) | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 741 | #define PB_SUBMSG_INFO_ONEOF(ltype, structname, fieldname) PB_SUBMSG_INFO_ONEOF2(ltype, structname, PB_ONEOF_NAME(UNION, | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 861 | #define PB_FI_WIDTH_PB_HTYPE_OPTIONAL(ltype) PB_FI_WIDTH ## ltype | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 881 | #define PB_FI_WIDTH_PB_LTYPE_STRING 2 | COMMENT |
| LOW | spm_headers/nanopb/pb.h | 921 | */ | COMMENT |
| LOW | spm_headers/nanopb/pb_decode.h | 61 | }; | 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 | 1332 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | generator/nanopb_generator.py | 1334 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | generator/nanopb_generator.py | 2389 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | generator/nanopb_generator.py | 2391 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | generator/nanopb_generator.py | 1213 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | generator/nanopb_generator.py | 1215 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | generator/nanopb_generator.py | 1750 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | generator/nanopb_generator.py | 1752 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | generator/nanopb_generator.py | 2500 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | generator/nanopb_generator.py | 2502 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | generator/nanopb_generator.py | 73 | # --------------------------------------------------------------------------- | STRING |
| MEDIUM | generator/nanopb_generator.py | 75 | # --------------------------------------------------------------------------- | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/site_scons/site_init.py | 22 | except ImportError: | CODE |
| HIGH | generator/platformio_generator.py | 76 | except FileExistsError: | CODE |
| HIGH | generator/platformio_generator.py | 81 | except FileExistsError: | CODE |
| HIGH | generator/platformio_generator.py | 163 | except FileNotFoundError: | CODE |
| 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 | 1329 | def requires_custom_field_callback(self): | CODE |
| LOW⚡ | generator/nanopb_generator.py | 2395 | def validate_options_namemask(namemask, filename, line_number): | CODE |
| LOW | generator/nanopb_generator.py | 537 | def enum_to_string_definition(self): | CODE |
| LOW | generator/nanopb_generator.py | 1120 | def requires_custom_field_callback(self): | CODE |
| LOW | generator/nanopb_generator.py | 1146 | def requires_custom_field_callback(self): | CODE |
| LOW | generator/nanopb_generator.py | 1592 | def fields_declaration_cpp_lookup(self, local_defines): | CODE |
| LOW | generator/nanopb_generator.py | 1628 | def required_descriptor_width(self, dependencies): | CODE |
| LOW | generator/nanopb_generator.py | 1785 | def check_recursive_dependencies(message, all_messages, root = None): | CODE |
| LOW | generator/nanopb_generator.py | 2023 | def discard_unused_automatic_types(self): | CODE |
| LOW | .github/workflows/fail_on_error.py | 7 | def codeql_sarif_contain_error(filename): | CODE |
| LOW | build-tests/platformio/test_platformio_generator.py | 104 | def test_options_cache_tracks_create_modify_and_delete(self): | CODE |
| LOW | build-tests/platformio/test_platformio_generator.py | 138 | def test_failed_regeneration_keeps_deleted_options_marker(self): | CODE |
| 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 | 1785 | CODE | |
| LOW | generator/nanopb_generator.py | 2462 | CODE | |
| LOW | generator/nanopb_generator.py | 2681 | CODE | |
| LOW | generator/nanopb_generator.py | 2740 | CODE | |
| LOW | generator/nanopb_generator.py | 603 | CODE | |
| LOW | generator/nanopb_generator.py | 794 | CODE | |
| LOW | generator/nanopb_generator.py | 857 | CODE | |
| LOW | generator/nanopb_generator.py | 994 | CODE | |
| LOW | generator/nanopb_generator.py | 1043 | CODE | |
| LOW | generator/nanopb_generator.py | 1292 | CODE | |
| LOW | generator/nanopb_generator.py | 1363 | CODE | |
| LOW | generator/nanopb_generator.py | 1672 | CODE | |
| LOW | generator/nanopb_generator.py | 1875 | CODE | |
| LOW | generator/nanopb_generator.py | 2045 | CODE | |
| LOW | generator/nanopb_generator.py | 2080 | CODE | |
| LOW | .github/workflows/fail_on_error.py | 7 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | generator/nanopb_generator.py | 695 | # Check if the field can be implemented with static allocation | COMMENT |
| LOW | generator/nanopb_generator.py | 2277 | # Check if there is any name mangling active | COMMENT |
| LOW | generator/nanopb_generator.py | 2326 | # Check if any messages exceed the 64 kB limit of 16-bit pb_size_t | COMMENT |
| LOW | generator/nanopb_generator.py | 2646 | # Check if there is a separate .options file | COMMENT |
| LOW | generator/nanopb_generator.py | 2724 | # Check if there were any lines in .options that did not match a member | COMMENT |
| LOW | generator/nanopb_generator.py | 2889 | # 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 | 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 | 520 | # Define the long names always so that enum value references | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | generator/nanopb_generator.py | 1064 | # just use the #define SubMessage_size from the header. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | generator/nanopb_generator.py | 2453 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | generator/nanopb_generator.py | 1626 | CODE |