Repository Analysis

78/xiaozhi-esp32

An MCP-based chatbot | 一个基于MCP的聊天机器人

13.5 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of 78/xiaozhi-esp32, a C++ project with 28,091 GitHub stars. SynthScan v2.0 examined 55,117 lines of code across 668 source files, recording 689 pattern matches distributed across 10 syntactic categories. The overall adjusted score of 13.5 places this repository in the Low AI signal 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).

13.5
Adjusted Score
13.5
Raw Score
100%
Time Factor
2026-07-07
Last Push
28.1K
Stars
C++
Language
55.1K
Lines of Code
668
Files
689
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

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 1MEDIUM 28LOW 660

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 689 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 Block583 hits · 583 pts
SeverityFileLineSnippetContext
LOWdocs/custom-board_zh.md41参考示例(来自lichuang-c3-dev):COMMENT
LOWdocs/custom-board_zh.md61#define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_1COMMENT
LOWdocs/custom-board_zh.md1411. **类定义**:继承自`WifiBoard`或`Ml307Board`COMMENT
LOWdocs/custom-board.md41- Display parameters and pins.COMMENT
LOWdocs/custom-board.md61#define AUDIO_CODEC_PA_PIN GPIO_NUM_13COMMENT
LOWdocs/custom-board.md141COMMENT
LOWscripts/Image_Converter/LVGLImage.py321 if premultiplied:COMMENT
LOWmain/application.h1#ifndef _APPLICATION_H_COMMENT
LOWmain/application.h21// Main event bitsCOMMENT
LOWmain/mcp_server.h1#ifndef MCP_SERVER_HCOMMENT
LOWmain/assets.h1#ifndef ASSETS_HCOMMENT
LOWmain/led/circular_strip.h1#ifndef _CIRCULAR_STRIP_H_COMMENT
LOWmain/audio/audio_service.h1#ifndef AUDIO_SERVICE_HCOMMENT
LOWmain/audio/audio_service.h41#define MAX_PLAYBACK_TASKS_IN_QUEUE 2COMMENT
LOWmain/audio/audio_codec.h1#ifndef _AUDIO_CODEC_HCOMMENT
LOWmain/audio/codecs/es8374_audio_codec.h41#endif // _ES8374_AUDIO_CODEC_HCOMMENT
LOWmain/audio/processors/afe_audio_processor.h1#ifndef AFE_AUDIO_PROCESSOR_HCOMMENT
LOWmain/audio/wake_words/custom_wake_word.h1#ifndef CUSTOM_WAKE_WORD_HCOMMENT
LOWmain/audio/wake_words/esp_wake_word.h1#ifndef ESP_WAKE_WORD_HCOMMENT
LOWmain/audio/wake_words/afe_wake_word.h1#ifndef AFE_WAKE_WORD_HCOMMENT
LOWmain/boards/movecall-moji-esp32s3/config.h1#ifndef _BOARD_CONFIG_H_COMMENT
LOWmain/boards/movecall-moji-esp32s3/config.h21COMMENT
LOWmain/boards/zhengchen-1.54tft-ml307/config.h1COMMENT
LOWmain/boards/zhengchen-1.54tft-ml307/config.h21#define DISPLAY_SDA GPIO_NUM_41COMMENT
LOWmain/boards/minsi-k08-dual/config.h1#ifndef _BOARD_CONFIG_H_COMMENT
LOWmain/boards/minsi-k08-dual/config.h21COMMENT
LOWmain/boards/esp-s3-lcd-ev-board-2/pin_config.h1COMMENT
LOWmain/boards/esp-s3-lcd-ev-board-2/pin_config.h21#define GC9503V_LCD_BK_LIGHT_OFF_LEVEL !GC9503V_LCD_BK_LIGHT_ON_LEVELCOMMENT
LOWmain/boards/esp-s3-lcd-ev-board-2/pin_config.h41COMMENT
LOWmain/boards/esp-s3-lcd-ev-board-2/esp_lcd_gc9503.c1/*COMMENT
LOWmain/boards/esp-s3-lcd-ev-board-2/esp_lcd_gc9503.c181// *INDENT-OFF*COMMENT
LOWmain/boards/esp-s3-lcd-ev-board-2/esp_lcd_gc9503.c201// {0x71, (uint8_t []){0x48}, 1, 0},COMMENT
LOWmain/boards/esp-s3-lcd-ev-board-2/esp_lcd_gc9503.c221// {0x7b, (uint8_t []){0x08, 0x13}, 2, 0},COMMENT
LOWmain/boards/esp-s3-lcd-ev-board-2/config.h1#ifndef _BOARD_CONFIG_H_COMMENT
LOWmain/boards/esp-s3-lcd-ev-board-2/config.h21COMMENT
LOWmain/boards/lichuang-dev/config.h1#ifndef _BOARD_CONFIG_H_COMMENT
LOWmain/boards/lichuang-dev/config.h21#define AUDIO_CODEC_ES7210_ADDR 0x82COMMENT
LOWmain/boards/lichuang-dev/config.h41#define CAMERA_PIN_PWDN GPIO_NUM_NCCOMMENT
LOWmain/boards/freenove-esp32s3-display-2.8-lcd/config.h1#ifndef _BOARD_CONFIG_H_COMMENT
LOWmain/boards/freenove-esp32s3-display-2.8-lcd/config.h21#define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDRCOMMENT
LOWmain/boards/freenove-esp32s3-display-2.8-lcd/config.h41#define DISPLAY_WIDTH 320COMMENT
LOWmain/boards/esp-box-lite/config.h1#ifndef _BOARD_CONFIG_H_COMMENT
LOWmain/boards/esp-box-lite/config.h21#define BUILTIN_LED_GPIO GPIO_NUM_NCCOMMENT
LOWmain/boards/esp-sensairshuttle/config.h1#ifndef _BOARD_CONFIG_H_COMMENT
LOWmain/boards/esp-sensairshuttle/config.h21#define DISPLAY_CS_PIN GPIO_NUM_25COMMENT
LOWmain/boards/esp-vocat/config.h1#ifndef _BOARD_CONFIG_H_COMMENT
LOWmain/boards/esp-vocat/config.h21#define AUDIO_I2S_GPIO_WS GPIO_NUM_39COMMENT
LOWmain/boards/esp-vocat/config.h41#define DISPLAY_MIRROR_X falseCOMMENT
LOWmain/boards/esp-vocat/config.h61#define UART1_TX_2 GPIO_NUM_5COMMENT
LOWmain/boards/doit-s3-aibox/config.h1#ifndef _BOARD_CONFIG_H_COMMENT
LOWmain/boards/doit-s3-aibox/config.h21#define BUILTIN_LED_GPIO GPIO_NUM_45COMMENT
LOWmain/boards/labplus-mpython-v3/config.h1COMMENT
LOWmain/boards/labplus-mpython-v3/config.h21#define BOOT_BUTTON_GPIO GPIO_NUM_0COMMENT
LOWmain/boards/atk-dnesp32s3-box2-4g/config.h21#define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_48COMMENT
LOWmain/boards/atk-dnesp32s3-box2-4g/config.h41#define XIO_VBUS_EN (IO_EXPANDER_PIN_NUM_11)COMMENT
LOWmain/boards/atk-dnesp32s3-box2-4g/config.h61#define LCD_PIN_D6 GPIO_NUM_4COMMENT
LOWmain/boards/bread-compact-wifi-lcd/config.h1#ifndef _BOARD_CONFIG_H_COMMENT
LOWmain/boards/bread-compact-wifi-lcd/config.h21#elseCOMMENT
LOWmain/boards/bread-compact-wifi-lcd/config.h41#define DISPLAY_DC_PIN GPIO_NUM_40COMMENT
LOWmain/boards/bread-compact-wifi-lcd/config.h61#ifdef CONFIG_LCD_ST7789_240X320_NO_IPSCOMMENT
523 more matches not shown…
Excessive Try-Catch Wrapping40 hits · 64 pts
SeverityFileLineSnippetContext
MEDIUMscripts/download_github_runs.py209 print("Error: GITHUB_TOKEN not found in environment variables.", file=sys.stderr)CODE
LOWscripts/download_github_runs.py287 except Exception as e:CODE
MEDIUMscripts/download_github_runs.py288 print(f"Error: {e}", file=sys.stderr)CODE
LOWscripts/release.py128 except Exception as e:CODE
LOWscripts/gen_lang.py185 except Exception as e:CODE
MEDIUMscripts/gen_lang.py186 print(f"Error: {e}")CODE
MEDIUMscripts/build_default_assets.py799 print(f"Error: Generated assets.bin not found: {image_file}")CODE
MEDIUMscripts/build_default_assets.py803 print(f"Error: Failed to build assets: {e}")CODE
MEDIUMscripts/build_default_assets.py201 print(f"Error: Failed to generate srmodels.bin: {e}")CODE
MEDIUMscripts/build_default_assets.py860 print("Error: USE_CUSTOM_WAKE_WORD is enabled but no multinet models are selected in sdkconfig")CODE
LOWscripts/build_default_assets.py802 except Exception as e:CODE
LOWscripts/build_default_assets.py200 except Exception as e:CODE
LOWscripts/versions.py219 except Exception as e:CODE
MEDIUMscripts/versions.py220 print(f"Error uploading version info: {str(e)}")CODE
LOWscripts/ogg_converter/xiaozhi_ogg_converter.py186 except Exception as e:CODE
LOWscripts/ogg_converter/xiaozhi_ogg_converter.py205 except Exception as e:CODE
LOWscripts/ogg_converter/xiaozhi_ogg_converter.py224 except Exception as e:CODE
LOWscripts/Image_Converter/lvgl_tools_gui.py245 except Exception as e:CODE
LOWscripts/p3_tools/batch_convert_gui.py187 except Exception as e:CODE
LOWscripts/p3_tools/batch_convert_gui.py201 except Exception as e:CODE
LOWscripts/p3_tools/batch_convert_gui.py215 except Exception as e:CODE
MEDIUMscripts/spiffs_assets/build.py72 print(f"Error: Failed to generate srmodels.bin: {e}")CODE
LOWscripts/spiffs_assets/build.py134 except Exception as e:CODE
MEDIUMscripts/spiffs_assets/build.py135 print(f"Error loading config file {config_path}: {e}")CODE
MEDIUMscripts/spiffs_assets/build.py151 print(f"Error: No src field found for emote '{emote_name}' in config")CODE
LOWscripts/spiffs_assets/build.py259 except Exception as e:CODE
MEDIUMscripts/spiffs_assets/build.py260 print(f"Error reading/processing layout.json: {e}")CODE
MEDIUMscripts/spiffs_assets/build.py391 print(f"Error: Failed to package assets.bin: {e}")CODE
MEDIUMscripts/spiffs_assets/spiffs_assets_gen.py101 print('Error: convert_path is NULL')CODE
LOWscripts/spiffs_assets/spiffs_assets_gen.py137 except Exception as e:CODE
MEDIUMscripts/spiffs_assets/spiffs_assets_gen.py254 print('An error occurred while executing LVGLImage.py:')CODE
LOWscripts/spiffs_assets/spiffs_assets_gen.py294 except Exception as e:CODE
MEDIUMscripts/spiffs_assets/spiffs_assets_gen.py295 print(f'An error occurred during conversion: {e}')CODE
MEDIUMscripts/spiffs_assets/spiffs_assets_gen.py305 print('Error: Height must be a positive integer')CODE
LOWscripts/spiffs_assets/spiffs_assets_gen.py314 except Exception as e:CODE
LOWscripts/spiffs_assets/spiffs_assets_gen.py418 except Exception as e:CODE
LOWscripts/spiffs_assets/build_all.py75 except Exception as e:CODE
LOWscripts/acoustic_check/graphic.py342 except Exception as e:CODE
LOWscripts/acoustic_check/graphic.py418 except Exception as e:CODE
LOWscripts/acoustic_check/main.py16 except Exception as e:CODE
Decorative Section Separators8 hits · 27 pts
SeverityFileLineSnippetContext
MEDIUMscripts/build_default_assets.py452# =============================================================================COMMENT
MEDIUMscripts/build_default_assets.py454# =============================================================================COMMENT
MEDIUMscripts/build_default_assets.py23# =============================================================================COMMENT
MEDIUMscripts/build_default_assets.py25# =============================================================================COMMENT
MEDIUMscripts/build_default_assets.py126# =============================================================================COMMENT
MEDIUMscripts/build_default_assets.py128# =============================================================================COMMENT
MEDIUMscripts/build_default_assets.py354# =============================================================================COMMENT
MEDIUMscripts/build_default_assets.py356# =============================================================================COMMENT
Deep Nesting29 hits · 26 pts
SeverityFileLineSnippetContext
LOWscripts/release.py74CODE
LOWscripts/release.py143CODE
LOWscripts/release.py267CODE
LOWscripts/build_default_assets.py58CODE
LOWscripts/build_default_assets.py218CODE
LOWscripts/build_default_assets.py456CODE
LOWscripts/build_default_assets.py482CODE
LOWscripts/build_default_assets.py531CODE
LOWscripts/build_default_assets.py571CODE
LOWscripts/versions.py61CODE
LOWscripts/versions.py223CODE
LOWscripts/Image_Converter/lvgl_tools_gui.py195CODE
LOWscripts/Image_Converter/LVGLImage.py212CODE
LOWscripts/Image_Converter/LVGLImage.py576CODE
LOWscripts/Image_Converter/LVGLImage.py787CODE
LOWscripts/Image_Converter/LVGLImage.py839CODE
LOWscripts/Image_Converter/LVGLImage.py875CODE
LOWscripts/Image_Converter/LVGLImage.py978CODE
LOWscripts/Image_Converter/LVGLImage.py1287CODE
LOWscripts/p3_tools/convert_p3_to_audio.py9CODE
LOWscripts/p3_tools/play_p3.py8CODE
LOWscripts/p3_tools/p3_gui_player.py12CODE
LOWscripts/spiffs_assets/spiffs_assets_gen.py141CODE
LOWscripts/spiffs_assets/spiffs_assets_gen.py391CODE
LOWscripts/spiffs_assets/spiffs_assets_gen.py492CODE
LOWscripts/spiffs_assets/build_all.py80CODE
LOWscripts/spiffs_assets/pack_model.py41CODE
LOWscripts/acoustic_check/demod.py179CODE
LOWscripts/acoustic_check/graphic.py118CODE
Redundant / Tautological Comments7 hits · 10 pts
SeverityFileLineSnippetContext
LOWscripts/download_github_runs.py87 # Check if there are more pagesCOMMENT
LOWscripts/download_github_runs.py254 # Check if file already existsCOMMENT
LOWscripts/audio_debug_server.py40 # Close files and socketCOMMENT
LOWscripts/build_default_assets.py225 # Check if this is otto-gif collectionCOMMENT
LOWscripts/build_default_assets.py913 # Check if we have anything to buildCOMMENT
LOWscripts/spiffs_assets/spiffs_assets_gen.py72 # Check if convert_path is not emptyCOMMENT
LOWscripts/spiffs_assets/spiffs_assets_gen.py117 # Check if the file already existsCOMMENT
Hyper-Verbose Identifiers11 hits · 10 pts
SeverityFileLineSnippetContext
LOWscripts/release.py17def get_board_type_from_compile_commands() -> Optional[str]:CODE
LOWscripts/release.py143def _find_board_config_candidates(board_type: str) -> list[str]:CODE
LOWscripts/release.py163def _extract_board_config_from_sdkconfig_append(sdkconfig_append: list[str]) -> Optional[str]:CODE
LOWscripts/build_default_assets.py456def read_wakenet_from_sdkconfig(sdkconfig_path):CODE
LOWscripts/build_default_assets.py482def read_multinet_from_sdkconfig(sdkconfig_path):CODE
LOWscripts/build_default_assets.py531def read_wake_word_type_from_sdkconfig(sdkconfig_path):CODE
LOWscripts/build_default_assets.py571def read_custom_wake_word_from_sdkconfig(sdkconfig_path):CODE
LOWscripts/build_default_assets.py624def get_language_from_multinet_models(multinet_models):CODE
LOWscripts/build_default_assets.py709def get_emoji_collection_path(default_emoji_collection, xiaozhi_fonts_path, project_root=None):CODE
LOWscripts/spiffs_assets/build.py138def process_board_emoji_collection(emoji_collection_dir, target_board_dir, assets_dir):CODE
LOWscripts/spiffs_assets/build.py192def process_board_icon_collection(icon_collection_dir, assets_dir):CODE
Self-Referential Comments3 hits · 9 pts
SeverityFileLineSnippetContext
MEDIUMscripts/audio_debug_server.py12 # Create a UDP socketCOMMENT
MEDIUMscripts/build_default_assets.py916 # Create an empty assets.bin fileCOMMENT
MEDIUMscripts/spiffs_assets/spiffs_assets_gen.py123 # Create the parent directories if they do not existCOMMENT
Unused Imports6 hits · 6 pts
SeverityFileLineSnippetContext
LOWscripts/download_github_runs.py17CODE
LOWscripts/download_github_runs.py19CODE
LOWscripts/spiffs_assets/build.py22CODE
LOWscripts/spiffs_assets/spiffs_assets_gen.py3CODE
LOWscripts/spiffs_assets/spiffs_assets_gen.py10CODE
LOWscripts/acoustic_check/graphic.py12CODE
Docstring Block Structure1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHscripts/download_github_runs.py126 Rename artifact according to the specified rules. Rules: - Remove "xiaozhi_" prefix - Remove hash STRING
AI Structural Patterns1 hit · 1 pts
SeverityFileLineSnippetContext
LOWscripts/Image_Converter/LVGLImage.py1285CODE