AI Slop Code RIsk Monitor

vnpy/vnpy

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

8.4 Moderate pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for vnpy/vnpy, a Python project with 45,797 GitHub stars. SynthScan examined 34,944 lines of code across 163 source files, recording 268 pattern matches distributed across 12 syntactic categories. The legacy adjusted pattern signal is 8.4 (Moderate 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.

8.4
Adjusted Signal
8.4
Raw Pattern Score
100%
Time Factor
2026-10-06
Last Push
45.8K
Stars
Python
Language
34.9K
Lines of Code
163
Files
268
Pattern Hits
2026-10-12
Scan Date
0.04
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 16.1/100 · LOW

Can maintainers explain intent, assumptions, and trade-offs? 115 finding(s).

Hallucinated Dependency & Supply Chain Risk 10.5/100 · LOW

Are imports declared and package/API names verified? 86 finding(s).

Agent Over-Engineering Ratio 21.6/100 · LOW

Are wrappers, guards, and repeated structures necessary? 143 finding(s).

PR Review Velocity Impact 35.4/100 · MEDIUM

Which changes need focused human review? 268 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

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.

Severity Breakdown

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.

CRITICAL 0HIGH 7MEDIUM 1LOW 260

Directory Score Breakdown

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.

Pattern Findings

The scanner identified 268 distinct pattern matches across 12 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.

Unused Imports86 hits · 78 pts
SeverityFileLineSnippetContext
LOWvnpy/trader/event.py5CODE
LOWvnpy/trader/utility.py16CODE
LOWvnpy/trader/utility.py16CODE
LOWvnpy/trader/converter.py19CODE
LOWvnpy/trader/logger.py8CODE
LOWvnpy/trader/logger.py8CODE
LOWvnpy/trader/logger.py8CODE
LOWvnpy/trader/logger.py8CODE
LOWvnpy/trader/logger.py8CODE
LOWvnpy/trader/app.py11CODE
LOWvnpy/trader/ui/__init__.py5CODE
LOWvnpy/trader/ui/__init__.py5CODE
LOWvnpy/trader/ui/__init__.py5CODE
LOWvnpy/trader/ui/__init__.py5CODE
LOWvnpy/trader/ui/__init__.py5CODE
LOWvnpy/trader/ui/__init__.py6CODE
LOWvnpy/chart/__init__.py5CODE
LOWvnpy/chart/__init__.py6CODE
LOWvnpy/chart/__init__.py6CODE
LOWvnpy/rpc/__init__.py5CODE
LOWvnpy/rpc/__init__.py6CODE
LOWvnpy/alpha/__init__.py5CODE
LOWvnpy/alpha/__init__.py6CODE
LOWvnpy/alpha/__init__.py6CODE
LOWvnpy/alpha/__init__.py6CODE
LOWvnpy/alpha/__init__.py6CODE
LOWvnpy/alpha/__init__.py7CODE
LOWvnpy/alpha/__init__.py8CODE
LOWvnpy/alpha/__init__.py8CODE
LOWvnpy/alpha/__init__.py9CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py211CODE
LOWvnpy/alpha/dataset/utility.py226CODE
LOWvnpy/alpha/dataset/utility.py226CODE
LOWvnpy/alpha/dataset/utility.py226CODE
LOWvnpy/alpha/dataset/utility.py226CODE
LOWvnpy/alpha/dataset/utility.py226CODE
LOWvnpy/alpha/dataset/utility.py233CODE
LOWvnpy/alpha/dataset/utility.py233CODE
LOWvnpy/alpha/dataset/utility.py237CODE
26 more matches not shown…
Hyper-Verbose Identifiers74 hits · 74 pts
SeverityFileLineSnippetContext
LOWtests/test_engine.py50def test_main_engine_routes_send_and_cancel_to_gateway() -> None:CODE
LOWtests/test_engine.py138def test_oms_convert_order_request_splits_only_after_contract() -> None:CODE
LOWtests/test_engine.py175def test_send_order_keeps_one_gateway_order_when_conversion_splits() -> None:CODE
LOWtests/test_alpha_backtesting.py101def test_order_from_first_bar_fills_on_second_bar() -> None:CODE
LOWtests/test_alpha_backtesting.py123def test_long_and_short_cross_prices_use_open() -> None:CODE
LOWtests/test_alpha_backtesting.py161def test_long_fill_cash_deducts_turnover_and_rate() -> None:CODE
LOWtests/test_alpha_backtesting.py189def test_execute_trading_price_add_rounds_to_tick() -> None:CODE
LOWtests/test_alpha_backtesting.py209def test_missing_bar_is_filled_for_cross_but_hidden_from_on_bars() -> None:CODE
LOWtests/test_utility.py21def test_extract_and_generate_vt_symbol() -> None:CODE
LOWtests/test_utility.py33def test_round_floor_and_ceil_to_price_tick() -> None:CODE
LOWtests/test_utility.py41def test_bar_generator_builds_one_minute_bar_from_ticks() -> None:CODE
LOWtests/test_utility.py113def test_bar_generator_updates_same_minute_extremes_and_deltas() -> None:CODE
LOWtests/test_utility.py144def test_bar_generator_keeps_new_extreme_on_the_new_minute_bar() -> None:CODE
LOWtests/test_utility.py181def test_bar_generator_ignores_unchanged_day_extreme_on_a_new_minute() -> None:CODE
LOWtests/test_utility.py210def test_bar_generator_ignores_day_extreme_and_cumulative_totals_on_the_first_tick() -> None:CODE
LOWtests/test_utility.py231def test_bar_generator_ignores_zero_low_in_the_same_minute() -> None:CODE
LOWtests/test_utility.py259def test_bar_generator_ignores_zero_low_on_a_new_minute() -> None:CODE
LOWtests/test_utility.py291def test_bar_generator_accepts_negative_extremes_in_the_same_minute() -> None:CODE
LOWtests/test_utility.py314def test_bar_generator_accepts_negative_extremes_on_a_new_minute() -> None:CODE
LOWtests/test_utility.py343def test_bar_generator_ignores_cumulative_total_rollback() -> None:CODE
LOWtests/test_utility.py372def test_bar_generator_absorbs_a_day_high_that_breaks_the_previous_session() -> None:CODE
LOWtests/test_utility.py406def test_bar_generator_absorbs_a_day_low_that_breaks_the_previous_session() -> None:CODE
LOWtests/test_utility.py433def test_bar_generator_ignores_a_day_range_inside_the_previous_session() -> None:CODE
LOWtests/test_utility.py467def test_bar_generator_completes_five_minute_window() -> None:CODE
LOWtests/test_utility.py504def test_load_json_writes_empty_object_when_file_is_missing() -> None:CODE
LOWtests/test_utility.py516def test_extract_vt_symbol_rejects_unknown_exchange() -> None:CODE
LOWtests/test_event.py6def test_event_engine_calls_registered_handler_once() -> None:CODE
LOWtests/test_data_services.py9def test_get_datafeed_empty_name_returns_base_singleton() -> None:CODE
LOWtests/test_data_services.py28def test_get_datafeed_missing_module_returns_base_singleton() -> None:CODE
LOWtests/test_data_services.py47def test_get_database_missing_module_falls_back_to_sqlite() -> None:CODE
LOWtests/test_object.py21def test_vt_symbol_joins_symbol_and_exchange() -> None:CODE
LOWtests/test_object.py60def test_order_request_builds_order_identity() -> None:CODE
LOWtests/test_object.py87def test_trade_and_quote_ids_include_gateway() -> None:CODE
LOWtests/test_object.py122def test_position_and_account_ids() -> None:CODE
LOWtests/test_object.py142def test_order_is_active_for_working_statuses() -> None:CODE
LOWtests/test_converter.py80def test_shfe_close_splits_today_then_yesterday() -> None:CODE
LOWtests/test_converter.py103def test_shfe_close_uses_yesterday_when_today_is_empty() -> None:CODE
LOWtests/test_converter.py112def test_shfe_close_subtracts_frozen_volume() -> None:CODE
LOWtests/test_converter.py130def test_shfe_short_close_uses_long_position() -> None:CODE
LOWtests/test_converter.py146def test_dce_close_stays_close() -> None:CODE
LOWtests/test_converter.py160def test_net_position_and_missing_contract_skip_conversion() -> None:CODE
LOWtests/test_converter.py171def test_ine_close_splits_today_then_yesterday() -> None:CODE
LOWtests/test_converter.py190def test_lock_dce_opens_when_opponent_has_today_position() -> None:CODE
LOWtests/test_converter.py217def test_lock_shfe_closes_yesterday_then_opens() -> None:CODE
LOWtests/test_converter.py234def test_net_shfe_closes_today_yesterday_then_opens() -> None:CODE
LOWtests/test_converter.py251def test_net_dce_closes_position_then_opens() -> None:CODE
LOWtests/test_converter.py281def test_update_trade_shfe_close_reduces_yesterday_only() -> None:CODE
LOWtests/test_converter.py295def test_update_trade_dce_close_reduces_today_then_yesterday() -> None:CODE
LOWtests/test_converter.py309def test_calculate_frozen_close_fills_today_then_yesterday() -> None:CODE
LOWtests/test_rpc.py78def test_remote_call_returns_value_and_wraps_server_exception() -> None:CODE
LOWtests/test_rpc.py98def test_empty_subscription_delivers_payload_and_hides_heartbeat() -> None:CODE
LOWtests/test_rpc.py114def test_topic_subscription_filters_prefixes_and_keeps_heartbeat() -> None:CODE
LOWtests/test_rpc.py137def test_publish_pickling_error_does_not_block_later_messages() -> None:CODE
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
LOWtests/alpha/test_expression.py47def test_delay_mean_and_rank_on_tiny_frame() -> None:CODE
LOWtests/alpha/test_cs_function.py43def test_cs_rank_matches_worldquant() -> None:CODE
14 more matches not shown…
Modern Structural Boilerplate56 hits · 56 pts
SeverityFileLineSnippetContext
LOWexamples/candle_chart/run.py38 def update_bar() -> None:CODE
LOWvnpy/trader/optimize.py75 def set_target(self, target_name: str) -> None:CODE
LOWvnpy/trader/utility.py211 def update_tick(self, tick: TickData) -> None:CODE
LOWvnpy/trader/utility.py270 def update_bar(self, bar: BarData) -> None:CODE
LOWvnpy/trader/utility.py281 def update_bar_minute_window(self, bar: BarData) -> None:CODE
LOWvnpy/trader/utility.py321 def update_bar_hour_window(self, bar: BarData) -> None:CODE
LOWvnpy/trader/utility.py444 def update_bar_daily_window(self, bar: BarData) -> None:CODE
LOWvnpy/trader/utility.py525 def update_bar(self, bar: BarData) -> None:CODE
LOWvnpy/trader/converter.py52 def update_position(self, position: PositionData) -> None:CODE
LOWvnpy/trader/converter.py65 def update_order(self, order: OrderData) -> None:CODE
LOWvnpy/trader/converter.py77 def update_order_request(self, req: OrderRequest, vt_orderid: str) -> None:CODE
LOWvnpy/trader/converter.py88 def update_trade(self, trade: TradeData) -> None:CODE
LOWvnpy/trader/converter.py353 def update_position(self, position: PositionData) -> None:CODE
LOWvnpy/trader/converter.py364 def update_trade(self, trade: TradeData) -> None:CODE
LOWvnpy/trader/converter.py375 def update_order(self, order: OrderData) -> None:CODE
LOWvnpy/trader/converter.py386 def update_order_request(self, req: OrderRequest, vt_orderid: str) -> None:CODE
LOWvnpy/trader/logger.py16__all__ = [CODE
LOWvnpy/trader/engine.py591 def update_order_request(self, req: OrderRequest, vt_orderid: str, gateway_name: str) -> None:CODE
LOWvnpy/trader/ui/widget.py78 def set_content(self, content: Any, data: Any) -> None:CODE
LOWvnpy/trader/ui/widget.py112 def set_content(self, content: Any, data: Any) -> None:CODE
LOWvnpy/trader/ui/widget.py131 def set_content(self, content: Any, data: Any) -> None:CODE
LOWvnpy/trader/ui/widget.py182 def set_content(self, content: Any, data: Any) -> None:CODE
LOWvnpy/trader/ui/widget.py208 def set_content(self, content: datetime | None, data: Any) -> None:CODE
LOWvnpy/trader/ui/widget.py241 def set_content(self, content: Any, data: Any) -> None:CODE
LOWvnpy/trader/ui/widget.py385 def update_old_row(self, data: Any) -> None:CODE
LOWvnpy/trader/ui/widget.py979 def set_vt_symbol(self) -> None:CODE
LOWvnpy/trader/ui/widget.py1099 def update_with_cell(self, cell: BaseCell) -> None:CODE
LOWvnpy/trader/ui/widget.py1365 def update_setting(self) -> None:STRING
LOWvnpy/trader/ui/__init__.py9__all__ = [CODE
LOWvnpy/chart/widget.py167 def update_history(self, history: list[BarData]) -> None:CODE
LOWvnpy/chart/widget.py181 def update_bar(self, bar: BarData) -> None:CODE
LOWvnpy/chart/widget.py196 def _update_plot_limits(self) -> None:CODE
LOWvnpy/chart/widget.py214 def _update_x_range(self) -> None:CODE
LOWvnpy/chart/widget.py225 def _update_y_range(self) -> None:CODE
LOWvnpy/chart/widget.py483 def _update_line(self) -> None:CODE
LOWvnpy/chart/widget.py499 def _update_label(self) -> None:CODE
LOWvnpy/chart/widget.py528 def update_info(self) -> None:CODE
LOWvnpy/chart/widget.py576 def _update_after_move(self) -> None:CODE
LOWvnpy/chart/__init__.py9__all__ = [CODE
LOWvnpy/chart/manager.py29 def update_history(self, history: list[BarData]) -> None:CODE
LOWvnpy/chart/manager.py51 def update_bar(self, bar: BarData) -> None:CODE
LOWvnpy/chart/item.py82 def update_history(self, history: list[BarData]) -> None:CODE
LOWvnpy/chart/item.py96 def update_bar(self, bar: BarData) -> None:CODE
LOWvnpy/rpc/__init__.py9__all__ = [CODE
LOWvnpy/alpha/__init__.py12__all__ = [CODE
LOWvnpy/alpha/dataset/__init__.py20__all__ = [CODE
LOWvnpy/alpha/dataset/template.py83 def set_label(self, expression: str) -> None:CODE
LOWvnpy/alpha/model/__init__.py8__all__ = [CODE
LOWvnpy/alpha/strategy/backtesting.py588 def update_daily_close(self, bars: dict[str, BarData], dt: datetime) -> None:CODE
LOWvnpy/alpha/strategy/backtesting.py913 def update_close_price(self, close_price: float) -> None:CODE
LOWvnpy/alpha/strategy/backtesting.py982 def update_close_prices(self, close_prices: dict[str, float]) -> None:CODE
LOWvnpy/alpha/strategy/__init__.py9__all__ = [CODE
LOWvnpy/alpha/strategy/template.py64 def update_trade(self, trade: TradeData) -> None:CODE
LOWvnpy/alpha/strategy/template.py73 def update_order(self, order: OrderData) -> None:CODE
LOWvnpy/alpha/strategy/template.py137 def set_target(self, vt_symbol: str, target: float) -> None:CODE
LOWvnpy/event/__init__.py8__all__ = [CODE
Redundant / Tautological Comments14 hits · 20 pts
SeverityFileLineSnippetContext
LOWvnpy/trader/utility.py314 # Check if window bar completedCOMMENT
LOWvnpy/trader/utility.py476 # Check if daily bar completedCOMMENT
LOWvnpy/alpha/lab.py127 # Check if file existsCOMMENT
LOWvnpy/alpha/lab.py133 # Open fileCOMMENT
LOWvnpy/alpha/lab.py200 # Check if file existsCOMMENT
LOWvnpy/alpha/lab.py206 # Open fileCOMMENT
LOWvnpy/alpha/model/models/lasso_model.py71 # Check if model existsCOMMENT
LOWvnpy/alpha/model/models/lgb_model.py91 # Check if model existsCOMMENT
LOWvnpy/alpha/model/models/mlp_model.py165 # Check if early stopping condition is metCOMMENT
LOWvnpy/alpha/strategy/backtesting.py281 # Check if bankruptcy occurredCOMMENT
LOWvnpy/alpha/strategy/backtesting.py303 # Check if bankruptcy occurredCOMMENT
LOWvnpy/alpha/strategy/backtesting.py359 # Output resultsCOMMENT
LOWvnpy/alpha/strategy/backtesting.py621 # Check if historical data for the specified time of the contract is obtainedCOMMENT
LOWvnpy/alpha/strategy/strategies/equity_demo_strategy.py76 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 Nesting16 hits · 16 pts
SeverityFileLineSnippetContext
LOWtests/test_alpha101.py9CODE
LOWvnpy/trader/converter.py88CODE
LOWvnpy/trader/converter.py131CODE
LOWvnpy/trader/converter.py411CODE
LOWvnpy/trader/wechat.py149CODE
LOWvnpy/trader/engine.py658CODE
LOWvnpy/trader/engine.py829CODE
LOWvnpy/trader/ui/widget.py405CODE
LOWvnpy/trader/ui/widget.py675CODE
LOWvnpy/trader/ui/widget.py1099CODE
LOWvnpy/trader/ui/widget.py1222CODE
LOWvnpy/trader/ui/widget.py1422CODE
LOWvnpy/chart/widget.py258CODE
LOWvnpy/alpha/lab.py317CODE
LOWvnpy/alpha/dataset/ts_function.py463CODE
LOWvnpy/alpha/strategy/template.py141CODE
Empty Error Handlers3 hits · 15 pts
SeverityFileLineSnippetContext
HIGHvnpy/trader/engine.py680except Empty:CODE
HIGHvnpy/trader/engine.py835except Empty:CODE
HIGHvnpy/event/engine.py65except Empty:CODE
Over-Commented Block7 hits · 7 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.py21# from vnpy_rohon import RohonGatewayCOMMENT
LOWexamples/veighna_trader/run.py61 # main_engine.add_gateway(ToraOptionGateway)COMMENT
LOWvnpy/__init__.py1# The MIT License (MIT)COMMENT
Excessive Try-Catch Wrapping4 hits · 4 pts
SeverityFileLineSnippetContext
LOWvnpy/trader/engine.py677 except Exception:CODE
LOWvnpy/trader/ui/widget.py1471 except Exception as exc:CODE
LOWvnpy/rpc/server.py122 except Exception as e: # noqaCODE
LOWvnpy/alpha/strategy/backtesting.py185 except Exception:CODE
AI Structural Patterns2 hits · 2 pts
SeverityFileLineSnippetContext
LOWvnpy/trader/optimize.py150CODE
LOWvnpy/alpha/model/models/mlp_model.py40CODE
AI Slop Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
MEDIUMvnpy/alpha/dataset/processor.py41 method: str, # robust/zscoreCODE
Overly Generic Function Names1 hit · 1 pts
SeverityFileLineSnippetContext
LOWvnpy/alpha/dataset/template.py175 def process_data(self) -> None:CODE