Open Source Flight Controller Firmware
This report presents the forensic synthetic code analysis of betaflight/betaflight, a C project with 11,213 GitHub stars. SynthScan v2.0 examined 2,223,081 lines of code across 3943 source files, recording 8288 pattern matches distributed across 7 syntactic categories. The overall adjusted score of 3.0 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).
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.
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 8288 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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | lib/test/gtest/inc/gtest/gtest-matchers.h | 1 | // Copyright 2007, Google Inc. | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-matchers.h | 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-matchers.h | 41 | COMMENT | |
| LOW | lib/test/gtest/inc/gtest/gtest-matchers.h | 61 | 4251 GTEST_MAYBE_5046_ /* class A needs to have dll-interface to be used by | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-matchers.h | 141 | public: | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-matchers.h | 161 | // "is empty" matcher probably only needs to explain what the actual | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-matchers.h | 601 | return os; | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-death-test.h | 1 | // Copyright 2005, Google Inc. | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-death-test.h | 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-death-test.h | 41 | #define GOOGLETEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-death-test.h | 61 | // tests. IMPORTANT: This is an internal utility. Using it may break the | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-death-test.h | 81 | // | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-death-test.h | 101 | // | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-death-test.h | 121 | // learn wherever you come from. In the following: 'A' denotes a | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-death-test.h | 141 | // A* matches 0 or many occurrences of A | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-death-test.h | 161 | // simplicity, the current implementation doesn't search the PATH | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-death-test.h | 221 | // since the sideeffects of the call are only visible in opt mode, and not | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-death-test.h | 241 | // // opt-mode has sideeffect visible. | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-death-test.h | 261 | // | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-death-test.h | 281 | // death tests are not supported. Those macros must compile on such systems | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-death-test.h | 301 | // terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-death-test.h | 321 | GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-spi.h | 1 | // Copyright 2007, Google Inc. | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-spi.h | 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-spi.h | 61 | }; | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-spi.h | 121 | } // namespace testing | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-spi.h | 181 | } \ | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-spi.h | 201 | // - You cannot stream a failure message to this macro. | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-assertion-result.h | 1 | // Copyright 2005, Google Inc. | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-assertion-result.h | 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-assertion-result.h | 41 | #include <memory> | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-assertion-result.h | 61 | // This class is useful for two purposes: | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-assertion-result.h | 81 | // Expected: true | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-assertion-result.h | 101 | // } | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-assertion-result.h | 121 | // if ((n % 2) == 0) | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-assertion-result.h | 141 | // This warning is off by default starting in Visual Studio 2019 but can be | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-message.h | 1 | // Copyright 2005, Google Inc. | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-message.h | 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-message.h | 41 | // to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-message.h | 61 | COMMENT | |
| LOW | lib/test/gtest/inc/gtest/gtest-message.h | 81 | // foo << 1 << " != " << 2; | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-message.h | 121 | // overloads are visible in either the std namespace or the global | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 1 | // Copyright 2008, Google Inc. | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 41 | // parameters without writing multiple copies of the same test. | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 81 | // Range(begin, end [, step]) - Yields values {begin, begin+step, | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 101 | COMMENT | |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 121 | const char* pets[] = {"cat", "dog"}; | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 141 | // | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 181 | #include "gtest/internal/gtest-param-util.h" | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 201 | // } | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 241 | // | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 261 | // | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 281 | // each with parameter values 'a' and 'b': | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 321 | // For example, this instantiates tests from test suite BarTest each | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 341 | // Synopsis: | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 361 | // Combine() allows the user to combine two or more sequences to produce | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 381 | // | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 401 | // } | COMMENT |
| LOW | lib/test/gtest/inc/gtest/gtest-param-test.h | 421 | // Example: | COMMENT |
| 8182 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | …/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_jpeg.c | 131 | (#) To control JPEG state you can use the following function: HAL_JPEG_GetState() | CODE |
| MEDIUM | …/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_ltdc.c | 58 | (#) To control LTDC state you can use the following function: HAL_LTDC_GetState() | CODE |
| MEDIUM | …/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dcmi.c | 42 | (#) To control DCMI state you can use the function HAL_DCMI_GetState(). | CODE |
| MEDIUM | …7/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dsi.c | 41 | (#) To control DSI state you can use the following function: HAL_DSI_GetState() | CODE |
| MEDIUM | …/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dcmi.c | 42 | (#) To control DCMI state you can use the function HAL_DCMI_GetState(). | CODE |
| MEDIUM | …/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_ltdc.c | 70 | (#) To control LTDC state you can use the following function: HAL_LTDC_GetState() | CODE |
| MEDIUM | …7/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dsi.c | 41 | (#) To control DSI state you can use the following function: HAL_DSI_GetState() | CODE |
| MEDIUM | …/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_jpeg.c | 131 | (#) To control JPEG state you can use the following function: HAL_JPEG_GetState() | CODE |
| MEDIUM | …/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_ltdc.c | 60 | (#) To control LTDC state you can use the following function: HAL_LTDC_GetState() | CODE |
| MEDIUM | …/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dcmi.c | 44 | (#) To control DCMI state you can use the function HAL_DCMI_GetState(). | CODE |
| MEDIUM | …Drivers/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_can.c | 52 | (#) To control CAN events you can use one of the following two methods: | CODE |
| MEDIUM | …rivers/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_hash.c | 49 | (#) To control HASH events you can use one of the following wo methods: | CODE |
| MEDIUM | …rivers/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_cryp.c | 36 | (#) To control CRYP events you can use one of the following two methods: | CODE |
| MEDIUM | …Drivers/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma.c | 40 | (#) Optionally, if the Circular mode is enabled, you can use the Double buffer mode by configuring | CODE |
| MEDIUM | …Drivers/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma.c | 64 | (#) To control DMA events you can use one of the following two methods: | CODE |
| MEDIUM | …Drivers/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma.c | 74 | (#) Optionally, if Circular mode and Double Buffer mode are enabled, you can modify | CODE |
| LOW | src/platform/STM32/exti.c | 233 | // don't forget to match cleanup with config | COMMENT |
| LOW | src/platform/APM32/eint_apm32.c | 123 | // don't forget to match cleanup with config | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | lib/test/gtest/inc/gtest/gtest-death-test.h | 152 | // This implementation is *not* meant to be as highly tuned or robust | COMMENT |
| MEDIUM | lib/test/gtest/inc/gtest/gtest-death-test.h | 224 | // In practice, this can be used to test functions that utilize the | COMMENT |
| MEDIUM | src/platform/STM32/sdio_h5xx.c | 243 | // Setting all the SDIO pins to high for a short time results in more robust initialisation. | COMMENT |
| MEDIUM | src/platform/STM32/sdio_h7xx.c | 239 | // Setting all the SDIO pins to high for a short time results in more robust initialisation. | COMMENT |
| MEDIUM | src/platform/STM32/sdio_n6xx.c | 307 | // Setting all the SDIO pins to high for a short time results in more robust initialisation. | COMMENT |
| MEDIUM | src/platform/X32/sdio_x32.c | 234 | // Setting all the SDIO pins to high for a short time results in more robust initialisation. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | src/platform/STM32/spa06_i3c_probe.c | 219 | // Step 0: input + pull-up. Both lines should read 1. | COMMENT |
| LOW⚡ | src/platform/STM32/spa06_i3c_probe.c | 228 | // Step 1: floating input. If the bus has an external pull-up the line | COMMENT |
| LOW⚡ | src/platform/STM32/spa06_i3c_probe.c | 237 | // Step 2: drive SCL (PC10) LOW as open-drain output, SDA stays floating. | COMMENT |
| LOW | src/platform/STM32/spa06_i3c_probe.c | 248 | // Step 3: drive SDA (PC11) LOW open-drain. | COMMENT |
| LOW⚡ | src/main/drivers/compass/compass_qmc5883.c | 195 | // Step 1: Write special XYZ sign configuration value to register 0x29 | COMMENT |
| LOW⚡ | src/main/drivers/compass/compass_qmc5883.c | 197 | // Step 2: Configure CONF1 register with continuous mode, 100Hz ODR, 8G range, and OSR1=8 | COMMENT |
| LOW⚡ | src/main/drivers/compass/compass_qmc5883.c | 199 | // Step 3: Configure CONF2 register with OSR2=8 oversampling settings | COMMENT |
| LOW | src/main/drivers/rx/rx_sx1280.c | 852 | // Next we need to check if we need to FHSS and then do so if needed | COMMENT |
| LOW | src/main/cli/cli.c | 2664 | // Actually, we need to check if the negated value would be < INT32_MIN | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | src/platform/STM32/spa06_i3c_probe.c | 219 | // Step 0: input + pull-up. Both lines should read 1. | COMMENT |
| LOW⚡ | src/platform/STM32/spa06_i3c_probe.c | 228 | // Step 1: floating input. If the bus has an external pull-up the line | COMMENT |
| LOW⚡ | src/platform/STM32/spa06_i3c_probe.c | 237 | // Step 2: drive SCL (PC10) LOW as open-drain output, SDA stays floating. | COMMENT |
| LOW | src/platform/STM32/spa06_i3c_probe.c | 248 | // Step 3: drive SDA (PC11) LOW open-drain. | COMMENT |
| LOW⚡ | src/main/drivers/compass/compass_qmc5883.c | 195 | // Step 1: Write special XYZ sign configuration value to register 0x29 | COMMENT |
| LOW⚡ | src/main/drivers/compass/compass_qmc5883.c | 197 | // Step 2: Configure CONF1 register with continuous mode, 100Hz ODR, 8G range, and OSR1=8 | COMMENT |
| LOW⚡ | src/main/drivers/compass/compass_qmc5883.c | 199 | // Step 3: Configure CONF2 register with OSR2=8 oversampling settings | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/platform/PICO/dshot_pico.c | 268 | // TODO: implement? | COMMENT |
| LOW | src/platform/PICO/system.c | 109 | //TODO: implement | COMMENT |
| LOW | src/platform/PICO/bus_spi_pico.c | 327 | //TODO: implement | COMMENT |
| LOW | src/main/msp/msp_protocol_v2_common.h | 26 | // TODO: implement new, extensible rangefinder protocol | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/test/sitl/sitl_harness.py | 1037 | def scenario_geofence_rth_rxloss(sitl, rc, fdm): | CODE |
| LOW | src/test/sitl/sitl_harness.py | 1112 | def rescue_engagement_asserts(sitl, variant): | CODE |