Repository Analysis

vnpy/vnpy

基于Python的开源量化交易平台开发框架

7.3 Low AI signal View on GitHub

Analysis Overview

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).

7.3
Adjusted Score
7.3
Raw Score
100%
Time Factor
2026-05-17
Last Push
42.9K
Stars
Python
Language
30.7K
Lines of Code
150
Files
204
Pattern Hits
2026-07-14
Scan Date
0.03
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 4MEDIUM 1LOW 199

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 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.

Unused Imports86 hits · 78 pts
SeverityFileLineSnippetContext
LOWvnpy/trader/event.py5CODE
LOWvnpy/trader/utility.py16CODE
LOWvnpy/trader/utility.py16CODE
LOWvnpy/trader/converter.py14CODE
LOWvnpy/trader/logger.py4CODE
LOWvnpy/trader/logger.py4CODE
LOWvnpy/trader/logger.py4CODE
LOWvnpy/trader/logger.py4CODE
LOWvnpy/trader/logger.py4CODE
LOWvnpy/trader/app.py7CODE
LOWvnpy/trader/ui/__init__.py1CODE
LOWvnpy/trader/ui/__init__.py1CODE
LOWvnpy/trader/ui/__init__.py1CODE
LOWvnpy/trader/ui/__init__.py1CODE
LOWvnpy/trader/ui/__init__.py1CODE
LOWvnpy/trader/ui/__init__.py2CODE
LOWvnpy/chart/__init__.py1CODE
LOWvnpy/chart/__init__.py2CODE
LOWvnpy/chart/__init__.py2CODE
LOWvnpy/rpc/__init__.py1CODE
LOWvnpy/rpc/__init__.py2CODE
LOWvnpy/alpha/__init__.py1CODE
LOWvnpy/alpha/__init__.py2CODE
LOWvnpy/alpha/__init__.py2CODE
LOWvnpy/alpha/__init__.py2CODE
LOWvnpy/alpha/__init__.py2CODE
LOWvnpy/alpha/__init__.py3CODE
LOWvnpy/alpha/__init__.py4CODE
LOWvnpy/alpha/__init__.py4CODE
LOWvnpy/alpha/__init__.py5CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py206CODE
LOWvnpy/alpha/dataset/utility.py221CODE
LOWvnpy/alpha/dataset/utility.py221CODE
LOWvnpy/alpha/dataset/utility.py221CODE
LOWvnpy/alpha/dataset/utility.py221CODE
LOWvnpy/alpha/dataset/utility.py221CODE
LOWvnpy/alpha/dataset/utility.py228CODE
LOWvnpy/alpha/dataset/utility.py228CODE
LOWvnpy/alpha/dataset/utility.py232CODE
26 more matches not shown…
Modern Structural Boilerplate56 hits · 60 pts
SeverityFileLineSnippetContext
LOWexamples/candle_chart/run.py34 def update_bar() -> None:CODE
LOWvnpy/trader/optimize.py65 def set_target(self, target_name: str) -> None:CODE
LOWvnpy/trader/utility.py204 def update_tick(self, tick: TickData) -> None:CODE
LOWvnpy/trader/utility.py262 def update_bar(self, bar: BarData) -> None:CODE
LOWvnpy/trader/utility.py273 def update_bar_minute_window(self, bar: BarData) -> None:CODE
LOWvnpy/trader/utility.py311 def update_bar_hour_window(self, bar: BarData) -> None:CODE
LOWvnpy/trader/utility.py430 def update_bar_daily_window(self, bar: BarData) -> None:CODE
LOWvnpy/trader/utility.py509 def update_bar(self, bar: BarData) -> None:CODE
LOWvnpy/trader/converter.py43 def update_position(self, position: PositionData) -> None:CODE
LOWvnpy/trader/converter.py54 def update_order(self, order: OrderData) -> None:CODE
LOWvnpy/trader/converter.py64 def update_order_request(self, req: OrderRequest, vt_orderid: str) -> None:CODE
LOWvnpy/trader/converter.py71 def update_trade(self, trade: TradeData) -> None:CODE
LOWvnpy/trader/converter.py319 def update_position(self, position: PositionData) -> None:CODE
LOWvnpy/trader/converter.py328 def update_trade(self, trade: TradeData) -> None:CODE
LOWvnpy/trader/converter.py337 def update_order(self, order: OrderData) -> None:CODE
LOWvnpy/trader/converter.py346 def update_order_request(self, req: OrderRequest, vt_orderid: str) -> None:CODE
LOWvnpy/trader/logger.py12__all__ = [CODE
LOWvnpy/trader/engine.py558 def update_order_request(self, req: OrderRequest, vt_orderid: str, gateway_name: str) -> None:CODE
LOWvnpy/trader/ui/widget.py76 def set_content(self, content: Any, data: Any) -> None:CODE
LOWvnpy/trader/ui/widget.py108 def set_content(self, content: Any, data: Any) -> None:CODE
LOWvnpy/trader/ui/widget.py125 def set_content(self, content: Any, data: Any) -> None:CODE
LOWvnpy/trader/ui/widget.py170 def set_content(self, content: Any, data: Any) -> None:CODE
LOWvnpy/trader/ui/widget.py194 def set_content(self, content: datetime | None, data: Any) -> None:CODE
LOWvnpy/trader/ui/widget.py221 def set_content(self, content: Any, data: Any) -> None:CODE
LOWvnpy/trader/ui/widget.py352 def update_old_row(self, data: Any) -> None:CODE
LOWvnpy/trader/ui/widget.py915 def set_vt_symbol(self) -> None:CODE
LOWvnpy/trader/ui/widget.py1034 def update_with_cell(self, cell: BaseCell) -> None:CODE
LOWvnpy/trader/ui/widget.py1277 def update_setting(self) -> None:CODE
LOWvnpy/trader/ui/__init__.py5__all__ = [CODE
LOWvnpy/chart/widget.py155 def update_history(self, history: list[BarData]) -> None:CODE
LOWvnpy/chart/widget.py168 def update_bar(self, bar: BarData) -> None:CODE
LOWvnpy/chart/widget.py182 def _update_plot_limits(self) -> None:CODE
LOWvnpy/chart/widget.py196 def _update_x_range(self) -> None:CODE
LOWvnpy/chart/widget.py206 def _update_y_range(self) -> None:CODE
LOWvnpy/chart/widget.py448 def _update_line(self) -> None:CODE
LOWvnpy/chart/widget.py461 def _update_label(self) -> None:CODE
LOWvnpy/chart/widget.py488 def update_info(self) -> None:CODE
LOWvnpy/chart/widget.py531 def _update_after_move(self) -> None:CODE
LOWvnpy/chart/__init__.py5__all__ = [CODE
LOWvnpy/chart/manager.py21 def update_history(self, history: list[BarData]) -> None:CODE
LOWvnpy/chart/manager.py42 def update_bar(self, bar: BarData) -> None:CODE
LOWvnpy/chart/item.py74 def update_history(self, history: list[BarData]) -> None:CODE
LOWvnpy/chart/item.py87 def update_bar(self, bar: BarData) -> None:CODE
LOWvnpy/rpc/__init__.py5__all__ = [CODE
LOWvnpy/alpha/__init__.py8__all__ = [CODE
LOWvnpy/alpha/dataset/__init__.py16__all__ = [CODE
LOWvnpy/alpha/dataset/template.py75 def set_label(self, expression: str) -> None:CODE
LOWvnpy/alpha/model/__init__.py4__all__ = [CODE
LOWvnpy/alpha/strategy/backtesting.py561 def update_daily_close(self, bars: dict[str, BarData], dt: datetime) -> None:CODE
LOWvnpy/alpha/strategy/backtesting.py870 def update_close_price(self, close_price: float) -> None:CODE
LOWvnpy/alpha/strategy/backtesting.py935 def update_close_prices(self, close_prices: dict[str, float]) -> None:CODE
LOWvnpy/alpha/strategy/__init__.py5__all__ = [CODE
LOWvnpy/alpha/strategy/template.py58 def update_trade(self, trade: TradeData) -> None:CODE
LOWvnpy/alpha/strategy/template.py67 def update_order(self, order: OrderData) -> None:CODE
LOWvnpy/alpha/strategy/template.py129 def set_target(self, vt_symbol: str, target: float) -> None:CODE
LOWvnpy/event/__init__.py4__all__ = [CODE
Redundant / Tautological Comments14 hits · 20 pts
SeverityFileLineSnippetContext
LOWvnpy/trader/utility.py304 # Check if window bar completedCOMMENT
LOWvnpy/trader/utility.py460 # Check if daily bar completedCOMMENT
LOWvnpy/alpha/lab.py120 # Check if file existsCOMMENT
LOWvnpy/alpha/lab.py126 # Open fileCOMMENT
LOWvnpy/alpha/lab.py188 # Check if file existsCOMMENT
LOWvnpy/alpha/lab.py194 # Open fileCOMMENT
LOWvnpy/alpha/model/models/lasso_model.py96 # Check if model existsCOMMENT
LOWvnpy/alpha/model/models/lgb_model.py134 # Check if model existsCOMMENT
LOWvnpy/alpha/model/models/mlp_model.py196 # Check if early stopping condition is metCOMMENT
LOWvnpy/alpha/strategy/backtesting.py257 # Check if bankruptcy occurredCOMMENT
LOWvnpy/alpha/strategy/backtesting.py279 # Check if bankruptcy occurredCOMMENT
LOWvnpy/alpha/strategy/backtesting.py335 # Output resultsCOMMENT
LOWvnpy/alpha/strategy/backtesting.py592 # Check if historical data for the specified time of the contract is obtainedCOMMENT
LOWvnpy/alpha/strategy/strategies/equity_demo_strategy.py71 if self.holding_days[vt_symbol] < self.min_days: # Check if holding period exceeds thresholdCODE
Cross-File Repetition4 hits · 20 pts
SeverityFileLineSnippetContext
HIGHdocs/community/app/portfolio_strategy.md0load historical bar data for initializing strategy.STRING
HIGHdocs/community/app/cta_strategy.md0load historical bar data for initializing strategy.STRING
HIGHdocs/community/app/spread_trading.md0load historical bar data for initializing strategy.STRING
HIGHdocs/elite/strategy/elite_spreadtrading.md0load historical bar data for initializing strategy.STRING
Deep Nesting15 hits · 15 pts
SeverityFileLineSnippetContext
LOWtests/test_alpha101.py9CODE
LOWvnpy/trader/converter.py71CODE
LOWvnpy/trader/converter.py112CODE
LOWvnpy/trader/converter.py367CODE
LOWvnpy/trader/wechat.py145CODE
LOWvnpy/trader/engine.py621CODE
LOWvnpy/trader/engine.py783CODE
LOWvnpy/trader/ui/widget.py369CODE
LOWvnpy/trader/ui/widget.py628CODE
LOWvnpy/trader/ui/widget.py1034CODE
LOWvnpy/trader/ui/widget.py1148CODE
LOWvnpy/trader/ui/widget.py1328CODE
LOWvnpy/chart/widget.py237CODE
LOWvnpy/alpha/lab.py301CODE
LOWvnpy/alpha/strategy/template.py133CODE
Hyper-Verbose Identifiers11 hits · 11 pts
SeverityFileLineSnippetContext
LOWtests/alpha/test_dataproxy.py40def test_dataproxy_scalar_and_reverse_operations() -> None:CODE
LOWtests/alpha/test_dataproxy.py58def test_dataproxy_between_proxy_operations() -> None:CODE
LOWtests/alpha/test_dataproxy.py73def test_dataproxy_unary_operations() -> None:CODE
LOWtests/alpha/test_dataproxy.py82def test_dataproxy_scalar_comparisons() -> None:CODE
LOWtests/alpha/test_dataproxy.py95def test_dataproxy_between_proxy_comparisons() -> None:CODE
LOWvnpy/trader/optimize.py83def check_optimization_setting(CODE
LOWvnpy/trader/converter.py168 def convert_order_request_shfe(self, req: OrderRequest) -> list[OrderRequest]:CODE
LOWvnpy/trader/converter.py202 def convert_order_request_lock(self, req: OrderRequest) -> list[OrderRequest]:CODE
LOWvnpy/trader/converter.py242 def convert_order_request_net(self, req: OrderRequest) -> list[OrderRequest]:CODE
LOWvnpy/alpha/dataset/processor.py153def process_robust_zscore_norm(CODE
LOWvnpy/alpha/model/models/mlp_model.py458 def _calculate_feature_importance(self) -> pd.DataFrame:CODE
Over-Commented Block10 hits · 10 pts
SeverityFileLineSnippetContext
LOWdocs/conf.py1# Configuration file for the Sphinx documentation builder.COMMENT
LOWdocs/conf.py61# The language for content autogenerated by Sphinx. Refer to documentationCOMMENT
LOWdocs/conf.py101 'show_related': TrueCOMMENT
LOWdocs/conf.py141latex_elements = {COMMENT
LOWexamples/veighna_trader/run.py1from vnpy.event import EventEngineCOMMENT
LOWexamples/veighna_trader/run.py21from vnpy_ctastrategy import CtaStrategyAppCOMMENT
LOWexamples/veighna_trader/run.py41COMMENT
LOWexamples/veighna_trader/run.py61COMMENT
LOWvnpy/__init__.py1# The MIT License (MIT)COMMENT
LOWvnpy/alpha/dataset/datasets/alpha_101.py281 # Alpha86COMMENT
Excessive Try-Catch Wrapping4 hits · 4 pts
SeverityFileLineSnippetContext
LOWvnpy/trader/engine.py637 except Exception:CODE
LOWvnpy/trader/ui/widget.py1371 except Exception as exc:CODE
LOWvnpy/rpc/server.py106 except Exception as e: # noqaCODE
LOWvnpy/alpha/strategy/backtesting.py163 except Exception:CODE
AI Structural Patterns2 hits · 2 pts
SeverityFileLineSnippetContext
LOWvnpy/trader/optimize.py132CODE
LOWvnpy/alpha/model/models/mlp_model.py35CODE
AI Slop Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
MEDIUMvnpy/alpha/dataset/processor.py36 method: str, # robust/zscoreCODE
Overly Generic Function Names1 hit · 1 pts
SeverityFileLineSnippetContext
LOWvnpy/alpha/dataset/template.py159 def process_data(self) -> None:CODE