基于Python的开源量化交易平台开发框架
This report presents the forensic synthetic code analysis of vnpy/vnpy, a Python project with 42,947 GitHub stars. SynthScan v2.0 examined 30,678 lines of code across 150 source files, recording 204 pattern matches distributed across 11 syntactic categories. The overall adjusted score of 7.3 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).
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 204 distinct pattern matches across 11 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 | vnpy/trader/event.py | 5 | CODE | |
| LOW | vnpy/trader/utility.py | 16 | CODE | |
| LOW | vnpy/trader/utility.py | 16 | CODE | |
| LOW | vnpy/trader/converter.py | 14 | CODE | |
| LOW | vnpy/trader/logger.py | 4 | CODE | |
| LOW | vnpy/trader/logger.py | 4 | CODE | |
| LOW | vnpy/trader/logger.py | 4 | CODE | |
| LOW | vnpy/trader/logger.py | 4 | CODE | |
| LOW | vnpy/trader/logger.py | 4 | CODE | |
| LOW | vnpy/trader/app.py | 7 | CODE | |
| LOW | vnpy/trader/ui/__init__.py | 1 | CODE | |
| LOW | vnpy/trader/ui/__init__.py | 1 | CODE | |
| LOW | vnpy/trader/ui/__init__.py | 1 | CODE | |
| LOW | vnpy/trader/ui/__init__.py | 1 | CODE | |
| LOW | vnpy/trader/ui/__init__.py | 1 | CODE | |
| LOW | vnpy/trader/ui/__init__.py | 2 | CODE | |
| LOW | vnpy/chart/__init__.py | 1 | CODE | |
| LOW | vnpy/chart/__init__.py | 2 | CODE | |
| LOW | vnpy/chart/__init__.py | 2 | CODE | |
| LOW | vnpy/rpc/__init__.py | 1 | CODE | |
| LOW | vnpy/rpc/__init__.py | 2 | CODE | |
| LOW | vnpy/alpha/__init__.py | 1 | CODE | |
| LOW | vnpy/alpha/__init__.py | 2 | CODE | |
| LOW | vnpy/alpha/__init__.py | 2 | CODE | |
| LOW | vnpy/alpha/__init__.py | 2 | CODE | |
| LOW | vnpy/alpha/__init__.py | 2 | CODE | |
| LOW | vnpy/alpha/__init__.py | 3 | CODE | |
| LOW | vnpy/alpha/__init__.py | 4 | CODE | |
| LOW | vnpy/alpha/__init__.py | 4 | CODE | |
| LOW | vnpy/alpha/__init__.py | 5 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 206 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 221 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 221 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 221 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 221 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 221 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 228 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 228 | CODE | |
| LOW | vnpy/alpha/dataset/utility.py | 232 | CODE | |
| 26 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | examples/candle_chart/run.py | 34 | def update_bar() -> None: | CODE |
| LOW | vnpy/trader/optimize.py | 65 | def set_target(self, target_name: str) -> None: | CODE |
| LOW | vnpy/trader/utility.py | 204 | def update_tick(self, tick: TickData) -> None: | CODE |
| LOW | vnpy/trader/utility.py | 262 | def update_bar(self, bar: BarData) -> None: | CODE |
| LOW | vnpy/trader/utility.py | 273 | def update_bar_minute_window(self, bar: BarData) -> None: | CODE |
| LOW | vnpy/trader/utility.py | 311 | def update_bar_hour_window(self, bar: BarData) -> None: | CODE |
| LOW | vnpy/trader/utility.py | 430 | def update_bar_daily_window(self, bar: BarData) -> None: | CODE |
| LOW | vnpy/trader/utility.py | 509 | def update_bar(self, bar: BarData) -> None: | CODE |
| LOW | vnpy/trader/converter.py | 43 | def update_position(self, position: PositionData) -> None: | CODE |
| LOW⚡ | vnpy/trader/converter.py | 54 | def update_order(self, order: OrderData) -> None: | CODE |
| LOW⚡ | vnpy/trader/converter.py | 64 | def update_order_request(self, req: OrderRequest, vt_orderid: str) -> None: | CODE |
| LOW⚡ | vnpy/trader/converter.py | 71 | def update_trade(self, trade: TradeData) -> None: | CODE |
| LOW⚡ | vnpy/trader/converter.py | 319 | def update_position(self, position: PositionData) -> None: | CODE |
| LOW⚡ | vnpy/trader/converter.py | 328 | def update_trade(self, trade: TradeData) -> None: | CODE |
| LOW⚡ | vnpy/trader/converter.py | 337 | def update_order(self, order: OrderData) -> None: | CODE |
| LOW⚡ | vnpy/trader/converter.py | 346 | def update_order_request(self, req: OrderRequest, vt_orderid: str) -> None: | CODE |
| LOW | vnpy/trader/logger.py | 12 | __all__ = [ | CODE |
| LOW | vnpy/trader/engine.py | 558 | def update_order_request(self, req: OrderRequest, vt_orderid: str, gateway_name: str) -> None: | CODE |
| LOW | vnpy/trader/ui/widget.py | 76 | def set_content(self, content: Any, data: Any) -> None: | CODE |
| LOW | vnpy/trader/ui/widget.py | 108 | def set_content(self, content: Any, data: Any) -> None: | CODE |
| LOW | vnpy/trader/ui/widget.py | 125 | def set_content(self, content: Any, data: Any) -> None: | CODE |
| LOW | vnpy/trader/ui/widget.py | 170 | def set_content(self, content: Any, data: Any) -> None: | CODE |
| LOW | vnpy/trader/ui/widget.py | 194 | def set_content(self, content: datetime | None, data: Any) -> None: | CODE |
| LOW | vnpy/trader/ui/widget.py | 221 | def set_content(self, content: Any, data: Any) -> None: | CODE |
| LOW | vnpy/trader/ui/widget.py | 352 | def update_old_row(self, data: Any) -> None: | CODE |
| LOW | vnpy/trader/ui/widget.py | 915 | def set_vt_symbol(self) -> None: | CODE |
| LOW | vnpy/trader/ui/widget.py | 1034 | def update_with_cell(self, cell: BaseCell) -> None: | CODE |
| LOW | vnpy/trader/ui/widget.py | 1277 | def update_setting(self) -> None: | CODE |
| LOW | vnpy/trader/ui/__init__.py | 5 | __all__ = [ | CODE |
| LOW | vnpy/chart/widget.py | 155 | def update_history(self, history: list[BarData]) -> None: | CODE |
| LOW | vnpy/chart/widget.py | 168 | def update_bar(self, bar: BarData) -> None: | CODE |
| LOW | vnpy/chart/widget.py | 182 | def _update_plot_limits(self) -> None: | CODE |
| LOW | vnpy/chart/widget.py | 196 | def _update_x_range(self) -> None: | CODE |
| LOW | vnpy/chart/widget.py | 206 | def _update_y_range(self) -> None: | CODE |
| LOW | vnpy/chart/widget.py | 448 | def _update_line(self) -> None: | CODE |
| LOW | vnpy/chart/widget.py | 461 | def _update_label(self) -> None: | CODE |
| LOW | vnpy/chart/widget.py | 488 | def update_info(self) -> None: | CODE |
| LOW | vnpy/chart/widget.py | 531 | def _update_after_move(self) -> None: | CODE |
| LOW | vnpy/chart/__init__.py | 5 | __all__ = [ | CODE |
| LOW | vnpy/chart/manager.py | 21 | def update_history(self, history: list[BarData]) -> None: | CODE |
| LOW | vnpy/chart/manager.py | 42 | def update_bar(self, bar: BarData) -> None: | CODE |
| LOW | vnpy/chart/item.py | 74 | def update_history(self, history: list[BarData]) -> None: | CODE |
| LOW | vnpy/chart/item.py | 87 | def update_bar(self, bar: BarData) -> None: | CODE |
| LOW | vnpy/rpc/__init__.py | 5 | __all__ = [ | CODE |
| LOW | vnpy/alpha/__init__.py | 8 | __all__ = [ | CODE |
| LOW | vnpy/alpha/dataset/__init__.py | 16 | __all__ = [ | CODE |
| LOW | vnpy/alpha/dataset/template.py | 75 | def set_label(self, expression: str) -> None: | CODE |
| LOW | vnpy/alpha/model/__init__.py | 4 | __all__ = [ | CODE |
| LOW | vnpy/alpha/strategy/backtesting.py | 561 | def update_daily_close(self, bars: dict[str, BarData], dt: datetime) -> None: | CODE |
| LOW | vnpy/alpha/strategy/backtesting.py | 870 | def update_close_price(self, close_price: float) -> None: | CODE |
| LOW | vnpy/alpha/strategy/backtesting.py | 935 | def update_close_prices(self, close_prices: dict[str, float]) -> None: | CODE |
| LOW | vnpy/alpha/strategy/__init__.py | 5 | __all__ = [ | CODE |
| LOW | vnpy/alpha/strategy/template.py | 58 | def update_trade(self, trade: TradeData) -> None: | CODE |
| LOW | vnpy/alpha/strategy/template.py | 67 | def update_order(self, order: OrderData) -> None: | CODE |
| LOW | vnpy/alpha/strategy/template.py | 129 | def set_target(self, vt_symbol: str, target: float) -> None: | CODE |
| LOW | vnpy/event/__init__.py | 4 | __all__ = [ | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | vnpy/trader/utility.py | 304 | # Check if window bar completed | COMMENT |
| LOW | vnpy/trader/utility.py | 460 | # Check if daily bar completed | COMMENT |
| LOW | vnpy/alpha/lab.py | 120 | # Check if file exists | COMMENT |
| LOW | vnpy/alpha/lab.py | 126 | # Open file | COMMENT |
| LOW | vnpy/alpha/lab.py | 188 | # Check if file exists | COMMENT |
| LOW | vnpy/alpha/lab.py | 194 | # Open file | COMMENT |
| LOW | vnpy/alpha/model/models/lasso_model.py | 96 | # Check if model exists | COMMENT |
| LOW | vnpy/alpha/model/models/lgb_model.py | 134 | # Check if model exists | COMMENT |
| LOW | vnpy/alpha/model/models/mlp_model.py | 196 | # Check if early stopping condition is met | COMMENT |
| LOW | vnpy/alpha/strategy/backtesting.py | 257 | # Check if bankruptcy occurred | COMMENT |
| LOW | vnpy/alpha/strategy/backtesting.py | 279 | # Check if bankruptcy occurred | COMMENT |
| LOW | vnpy/alpha/strategy/backtesting.py | 335 | # Output results | COMMENT |
| LOW | vnpy/alpha/strategy/backtesting.py | 592 | # Check if historical data for the specified time of the contract is obtained | COMMENT |
| LOW | vnpy/alpha/strategy/strategies/equity_demo_strategy.py | 71 | if self.holding_days[vt_symbol] < self.min_days: # Check if holding period exceeds threshold | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | docs/community/app/portfolio_strategy.md | 0 | load historical bar data for initializing strategy. | STRING |
| HIGH | docs/community/app/cta_strategy.md | 0 | load historical bar data for initializing strategy. | STRING |
| HIGH | docs/community/app/spread_trading.md | 0 | load historical bar data for initializing strategy. | STRING |
| HIGH | docs/elite/strategy/elite_spreadtrading.md | 0 | load historical bar data for initializing strategy. | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_alpha101.py | 9 | CODE | |
| LOW | vnpy/trader/converter.py | 71 | CODE | |
| LOW | vnpy/trader/converter.py | 112 | CODE | |
| LOW | vnpy/trader/converter.py | 367 | CODE | |
| LOW | vnpy/trader/wechat.py | 145 | CODE | |
| LOW | vnpy/trader/engine.py | 621 | CODE | |
| LOW | vnpy/trader/engine.py | 783 | CODE | |
| LOW | vnpy/trader/ui/widget.py | 369 | CODE | |
| LOW | vnpy/trader/ui/widget.py | 628 | CODE | |
| LOW | vnpy/trader/ui/widget.py | 1034 | CODE | |
| LOW | vnpy/trader/ui/widget.py | 1148 | CODE | |
| LOW | vnpy/trader/ui/widget.py | 1328 | CODE | |
| LOW | vnpy/chart/widget.py | 237 | CODE | |
| LOW | vnpy/alpha/lab.py | 301 | CODE | |
| LOW | vnpy/alpha/strategy/template.py | 133 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/alpha/test_dataproxy.py | 40 | def test_dataproxy_scalar_and_reverse_operations() -> None: | CODE |
| LOW | tests/alpha/test_dataproxy.py | 58 | def test_dataproxy_between_proxy_operations() -> None: | CODE |
| LOW | tests/alpha/test_dataproxy.py | 73 | def test_dataproxy_unary_operations() -> None: | CODE |
| LOW | tests/alpha/test_dataproxy.py | 82 | def test_dataproxy_scalar_comparisons() -> None: | CODE |
| LOW | tests/alpha/test_dataproxy.py | 95 | def test_dataproxy_between_proxy_comparisons() -> None: | CODE |
| LOW | vnpy/trader/optimize.py | 83 | def check_optimization_setting( | CODE |
| LOW | vnpy/trader/converter.py | 168 | def convert_order_request_shfe(self, req: OrderRequest) -> list[OrderRequest]: | CODE |
| LOW | vnpy/trader/converter.py | 202 | def convert_order_request_lock(self, req: OrderRequest) -> list[OrderRequest]: | CODE |
| LOW | vnpy/trader/converter.py | 242 | def convert_order_request_net(self, req: OrderRequest) -> list[OrderRequest]: | CODE |
| LOW | vnpy/alpha/dataset/processor.py | 153 | def process_robust_zscore_norm( | CODE |
| LOW | vnpy/alpha/model/models/mlp_model.py | 458 | def _calculate_feature_importance(self) -> pd.DataFrame: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/conf.py | 1 | # Configuration file for the Sphinx documentation builder. | COMMENT |
| LOW | docs/conf.py | 61 | # The language for content autogenerated by Sphinx. Refer to documentation | COMMENT |
| LOW | docs/conf.py | 101 | 'show_related': True | COMMENT |
| LOW | docs/conf.py | 141 | latex_elements = { | COMMENT |
| LOW | examples/veighna_trader/run.py | 1 | from vnpy.event import EventEngine | COMMENT |
| LOW | examples/veighna_trader/run.py | 21 | from vnpy_ctastrategy import CtaStrategyApp | COMMENT |
| LOW | examples/veighna_trader/run.py | 41 | COMMENT | |
| LOW | examples/veighna_trader/run.py | 61 | COMMENT | |
| LOW | vnpy/__init__.py | 1 | # The MIT License (MIT) | COMMENT |
| LOW | vnpy/alpha/dataset/datasets/alpha_101.py | 281 | # Alpha86 | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | vnpy/trader/engine.py | 637 | except Exception: | CODE |
| LOW | vnpy/trader/ui/widget.py | 1371 | except Exception as exc: | CODE |
| LOW | vnpy/rpc/server.py | 106 | except Exception as e: # noqa | CODE |
| LOW | vnpy/alpha/strategy/backtesting.py | 163 | except Exception: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | vnpy/trader/optimize.py | 132 | CODE | |
| LOW | vnpy/alpha/model/models/mlp_model.py | 35 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | vnpy/alpha/dataset/processor.py | 36 | method: str, # robust/zscore | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | vnpy/alpha/dataset/template.py | 159 | def process_data(self) -> None: | CODE |