From 37625317811ac6b621c1735c9bd7f95aa07afa13 Mon Sep 17 00:00:00 2001 From: DKChan <524912269@qq.com> Date: Sun, 25 Oct 2026 17:22:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E7=A8=8B(S13=E5=9F=BA=E7=BA=BF?= =?UTF-8?q?=E9=94=AE=E6=B2=BB=E6=9C=AC):=20=E9=94=AE=E6=94=B9=E6=96=87?= =?UTF-8?q?=E4=BB=B6|=E8=A7=84=E5=88=99|=E5=87=BD=E6=95=B0=E5=90=8D?= =?UTF-8?q?=EF=BC=8B=E6=81=B6=E5=8C=96=E5=88=A4=E6=8D=AE=E8=B6=85=E7=99=BB?= =?UTF-8?q?=E8=AE=B0=E5=80=BC=E5=8D=B3=E7=BA=A2=EF=BC=8Brefresh=20?= =?UTF-8?q?=E5=AF=B9=E8=B4=A6=E4=B8=8E=E9=AA=A4=E9=99=8D=E5=AE=88=E5=8D=AB?= =?UTF-8?q?=EF=BC=8C=E5=9F=BA=E7=BA=BF=E9=87=8D=E7=94=9F=E6=88=90=20234=20?= =?UTF-8?q?=E6=9D=A1=EF=BC=8C--code=20=E5=9F=9F=E9=97=B8=E5=85=A8=E7=BB=BF?= =?UTF-8?q?=EF=BC=88=E5=9B=9E=E6=89=A7=20domain=3Dcode=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/tests/README.md | 2 +- game/tests/static_scan.sh | 10 +- tools/gdstyle_baseline.txt | 451 +++++++++++++++++++------------------ tools/gdstyle_gate.py | 169 +++++++++++--- 4 files changed, 367 insertions(+), 265 deletions(-) diff --git a/game/tests/README.md b/game/tests/README.md index 8a376419..ec97fdee 100644 --- a/game/tests/README.md +++ b/game/tests/README.md @@ -61,7 +61,7 @@ tests/ | `tests/run_all.gd`(单元与集成) | 公式/状态机/契约/跨系统闭环(40 套件 manifest) | 退出码+三硬闸(见下) | 新套件单跑调试;逻辑改动的最小单元复跑 | | `tools/probe_gate.sh`(场景探针,`--click`/`--full` 两模式) | UI 可达性、可见性、状态——真实实例化场景+真实输入路径 | 探针自检+退出码 | 新增 UI 区域的配套探针直跑与断言复核 | | `tools/render_gate.sh`(渲染 golden) | 画面基线——截图与基线图逐像素容差比对 | golden 比对脚本(依赖 PIL) | 主题/素材/排版类改动;窗口化运行,需开显示器 | -| `game/tests/static_scan.sh`(S 域) | 项目纪律+第三方质量规则:RNG 单点/core 纯度/类型标注/文件头/注释禁词/旧符号残留;S13=gdstyle 质量规则(重复 load、循环内 await、循环内分配、不可达代码等真缺陷类,存量基线外新违规才红) | 退出码(逐规则 FAIL 行) | 改产品码前后的快速自检;新增纪律先补扫描规则再修码 | +| `game/tests/static_scan.sh`(S 域) | 项目纪律+第三方质量规则:RNG 单点/core 纯度/类型标注/文件头/注释禁词/旧符号残留;S13=gdstyle 质量规则(重复 load、循环内 await、循环内分配、不可达代码等真缺陷类;基线键=文件|规则|函数名(类/文件级=文件|规则,无数字条目带消息),数字漂移不假红,同键指标恶化超基线登记值即红) | 退出码(逐规则 FAIL 行) | 改产品码前后的快速自检;新增纪律先补扫描规则再修码 | | `tools/parity_anchor.py`(回放对拍) | 同种子下三变体逐位确定性 | 工具脚本逐位比对 | 本批触及数值/存档/RNG/结算面时;须用户批准发起 | | 测量件(`game/sim/`,逐件见下「游离脚本台账」) | 期望/分布读数——只给读数,不判对错 | 人工读 stdout 或配套工具脚本 | 调参与归因;MC 类一律用户发起(档位表见 `sim-data/README.md`「MC 采集档位表」) | diff --git a/game/tests/static_scan.sh b/game/tests/static_scan.sh index 0fa07111..0582fd30 100644 --- a/game/tests/static_scan.sh +++ b/game/tests/static_scan.sh @@ -240,14 +240,16 @@ fi # 规则说明自持本头注(随 S11/S12 惯例):gdstyle(github.com/atelico/gdstyle,Rust 单二进制)只开 # quality/* 抓真缺陷(重复 load/循环内 await/循环内分配/不可达代码/自比较/字典重复键/残留 # print 等),format/*/naming/*/order/* 与 S9/S10 职能重叠全关;扫描面=产品码三目录(与 S9 同口径, -# probe/sim/tests 测量面直构惯例不在面)。存量基线 tools/gdstyle_baseline.txt(文件|规则|消息 三元组 -# ——消息含违规对象标识,行漂移稳定),只有基线外新违规才红;基线重生成=人工专用 -# (python tools/gdstyle_gate.py --refresh),禁清基线换绿。二进制本机固定路径 +# probe/sim/tests 测量面直构惯例不在面)。存量基线 tools/gdstyle_baseline.txt 用稳定身份键(函数级带数 +# 条目=文件|规则|函数名,类级/文件级带数条目=文件|规则,均带登记数值;无数字条目=文件|规则|消息全文 +# 裸键)——消息里的行数/分支数等计数漂移不假红;判定=基线外新违规红(NEW)+同键指标较登记值恶化红 +# (WORSENED),改小/持平不红。基线重生成=人工专用(python tools/gdstyle_gate.py --refresh,附对账; +# 键数骤降逾 10% 须 --force),禁清基线换绿。二进制本机固定路径 # D:/code/gdstyle/gdstyle.exe(不入库),GDSTYLE_BIN 环境变量覆盖;版本与钉定版不符即红(升级须重测)。 if python tools/gdstyle_gate.py; then echo "[static_scan] S13 ok" else - echo "[static_scan] S13 FAIL: 基线外新违规或二进制/版本/扫描面问题(清单见上)" + echo "[static_scan] S13 FAIL: 基线外新违规/指标恶化或二进制/版本/扫描面问题(清单见上)" fail=1 fi diff --git a/tools/gdstyle_baseline.txt b/tools/gdstyle_baseline.txt index a1907ed9..512e5f4e 100644 --- a/tools/gdstyle_baseline.txt +++ b/tools/gdstyle_baseline.txt @@ -1,236 +1,241 @@ -# gdstyle 存量基线(S13)——文件|规则|消息 三元组,每行一条;只记基线不记豁免理由。 -# 重生成=人工专用:python tools/gdstyle_gate.py --refresh(禁清基线换绿;改规则口径/工具升级须随批重生成)。 -game/core/action_economy.gd|quality/max-class-variables|class has 18 variables (max 15) -game/core/adventure_runner.gd|quality/max-branches|function '_apply_curio_pick' has 10 branches (max 8) -game/core/adventure_runner.gd|quality/max-branches|function '_draw_curio_candidates' has 11 branches (max 8) -game/core/adventure_runner.gd|quality/max-branches|function 'resume_adventure' has 11 branches (max 8) -game/core/adventure_runner.gd|quality/max-class-variables|class has 42 variables (max 15) -game/core/adventure_runner.gd|quality/max-file-length|file is 1051 lines long (max 1000) -game/core/adventure_runner.gd|quality/max-function-length|function '_draw_curio_candidates' is 85 lines long (max 50) -game/core/adventure_runner.gd|quality/max-function-length|function '_start_current_level' is 53 lines long (max 50) -game/core/adventure_runner.gd|quality/max-function-length|function 'resume_adventure' is 108 lines long (max 50) -game/core/adventure_runner.gd|quality/max-local-variables|function '_draw_curio_candidates' has 26 local variables (max 10) -game/core/adventure_runner.gd|quality/max-local-variables|function 'resume_adventure' has 13 local variables (max 10) -game/core/adventure_runner.gd|quality/max-public-methods|class has 23 public methods (max 20) -game/core/adventure_runner.gd|quality/max-returns|function '_apply_curio_pick' has 9 return statements (max 6) -game/core/battle_orchestrator.gd|quality/max-branches|function 'begin_battle' has 17 branches (max 8) -game/core/battle_orchestrator.gd|quality/max-branches|function 'use_treasure' has 18 branches (max 8) -game/core/battle_orchestrator.gd|quality/max-class-variables|class has 50 variables (max 15) -game/core/battle_orchestrator.gd|quality/max-file-length|file is 1302 lines long (max 1000) -game/core/battle_orchestrator.gd|quality/max-function-length|function '_place_variants' is 52 lines long (max 50) -game/core/battle_orchestrator.gd|quality/max-function-length|function 'begin_battle' is 141 lines long (max 50) -game/core/battle_orchestrator.gd|quality/max-function-length|function 'use_treasure' is 62 lines long (max 50) -game/core/battle_orchestrator.gd|quality/max-local-variables|function '_place_variants' has 14 local variables (max 10) -game/core/battle_orchestrator.gd|quality/max-local-variables|function 'begin_battle' has 16 local variables (max 10) -game/core/battle_orchestrator.gd|quality/max-local-variables|function 'use_treasure' has 11 local variables (max 10) -game/core/battle_orchestrator.gd|quality/max-nesting-depth|function '_place_variants' has nesting depth 6 (max 4) -game/core/battle_orchestrator.gd|quality/max-parameters|function '_apply_flat_row' has 7 parameters (max 5) -game/core/battle_orchestrator.gd|quality/max-parameters|function '_apply_gp_row' has 6 parameters (max 5) -game/core/battle_orchestrator.gd|quality/max-parameters|function '_apply_percent_row' has 6 parameters (max 5) -game/core/battle_orchestrator.gd|quality/max-parameters|function '_dispatch_row' has 6 parameters (max 5) -game/core/battle_orchestrator.gd|quality/max-parameters|function '_emit_row' has 8 parameters (max 5) -game/core/battle_orchestrator.gd|quality/max-parameters|function '_grant_routed' has 8 parameters (max 5) -game/core/battle_orchestrator.gd|quality/max-parameters|function '_submit_flat_hero' has 7 parameters (max 5) -game/core/battle_orchestrator.gd|quality/max-returns|function '_apply_flat_row' has 9 return statements (max 6) -game/core/battle_orchestrator.gd|quality/max-returns|function '_fx_fact' has 7 return statements (max 6) -game/core/battle_orchestrator.gd|quality/max-returns|function 'begin_battle' has 7 return statements (max 6) -game/core/battle_orchestrator.gd|quality/max-returns|function 'use_treasure' has 8 return statements (max 6) -game/core/board_generator.gd|quality/max-branches|function 'measure_inferability' has 12 branches (max 8) -game/core/board_generator.gd|quality/max-function-length|function '_attempt' is 51 lines long (max 50) -game/core/board_generator.gd|quality/max-function-length|function 'generate' is 62 lines long (max 50) -game/core/board_generator.gd|quality/max-function-length|function 'measure_inferability' is 64 lines long (max 50) -game/core/board_generator.gd|quality/max-local-variables|function 'generate' has 14 local variables (max 10) -game/core/board_generator.gd|quality/max-local-variables|function 'measure_inferability' has 13 local variables (max 10) -game/core/board_generator.gd|quality/max-nesting-depth|function 'measure_inferability' has nesting depth 5 (max 4) -game/core/board_generator.gd|quality/max-parameters|function '_finalize' has 6 parameters (max 5) -game/core/config_db.gd|quality/max-class-variables|class has 25 variables (max 15) -game/core/config_db.gd|quality/max-public-methods|class has 44 public methods (max 20) -game/core/config_db_cross_validator.gd|quality/max-branches|function 'cross_validate' has 21 branches (max 8) -game/core/config_db_cross_validator.gd|quality/max-function-length|function 'cross_validate' is 107 lines long (max 50) -game/core/config_db_cross_validator.gd|quality/max-local-variables|function 'cross_validate' has 24 local variables (max 10) -game/core/config_db_cross_validator.gd|quality/max-local-variables|function 'validate_skill_pool_links' has 11 local variables (max 10) -game/core/config_db_cross_validator.gd|quality/max-nesting-depth|function 'cross_validate' has nesting depth 5 (max 4) -game/core/config_db_resolver.gd|quality/max-branches|function '_resolve_progress' has 16 branches (max 8) -game/core/config_db_resolver.gd|quality/max-branches|function 'resolve_enemy_rowset' has 12 branches (max 8) -game/core/config_db_resolver.gd|quality/max-function-length|function '_resolve_progress' is 52 lines long (max 50) -game/core/config_db_resolver.gd|quality/max-local-variables|function '_resolve_progress' has 11 local variables (max 10) -game/core/damage_controller.gd|quality/max-branches|function '_hero_attack_ctx' has 9 branches (max 8) -game/core/damage_controller.gd|quality/max-branches|function '_hero_attack_redeem' has 10 branches (max 8) -game/core/damage_controller.gd|quality/max-class-variables|class has 19 variables (max 15) -game/core/damage_controller.gd|quality/max-function-length|function '_hero_attack_ctx' is 61 lines long (max 50) -game/core/damage_controller.gd|quality/max-function-length|function '_hero_attack_redeem' is 54 lines long (max 50) -game/core/damage_controller.gd|quality/max-local-variables|function '_hero_attack_ctx' has 16 local variables (max 10) -game/core/damage_controller.gd|quality/max-local-variables|function '_hero_attack_redeem' has 12 local variables (max 10) -game/core/damage_controller.gd|quality/max-local-variables|function '_resolve_enemy_skill' has 13 local variables (max 10) -game/core/damage_controller.gd|quality/max-parameters|function 'open_ticket' has 12 parameters (max 5) -game/core/effect_engine.gd|quality/max-branches|function 'validate_trigger_row' has 14 branches (max 8) -game/core/effect_engine.gd|quality/max-function-length|function '_cond_ok' is 52 lines long (max 50) -game/core/effect_engine.gd|quality/max-function-length|function 'rebuild' is 55 lines long (max 50) -game/core/effect_engine.gd|quality/max-local-variables|function 'validate_trigger_row' has 11 local variables (max 10) -game/core/effect_engine.gd|quality/max-nesting-depth|function '_cond_ok' has nesting depth 5 (max 4) -game/core/effect_engine.gd|quality/max-nesting-depth|function 'rebuild' has nesting depth 5 (max 4) -game/core/effect_engine.gd|quality/max-returns|function '_cond_ok' has 19 return statements (max 6) +# gdstyle 存量基线(S13)——键每行一条;只记基线不记豁免理由。 +# 键形态(稳定身份键,计数漂移不换键):函数级带数条目=文件|规则|函数名;类级/文件级带数条目 +# (class variables/public methods/file length)=文件|规则;无数字条目=文件|规则|消息全文(裸键)。 +# 带数条目行格式「键 = 数值」,数值=消息剥掉 (max N) 段后首个整数;无数字条目裸键。 +# 判定=键不在基线红(NEW)、同键数值较登记值恶化红(WORSENED)、改小/持平不红。 +# 重生成=人工专用:python tools/gdstyle_gate.py --refresh(禁清基线换绿;改规则口径/工具升级须随批 +# 重生成;新键数较旧基线少逾 10% 须加 --force 显式确认)。 +game/core/action_economy.gd|quality/max-class-variables = 18 +game/core/adventure_runner.gd|quality/max-branches|_apply_curio_pick = 10 +game/core/adventure_runner.gd|quality/max-branches|_draw_curio_candidates = 11 +game/core/adventure_runner.gd|quality/max-branches|resume_adventure = 11 +game/core/adventure_runner.gd|quality/max-class-variables = 42 +game/core/adventure_runner.gd|quality/max-file-length = 1051 +game/core/adventure_runner.gd|quality/max-function-length|_draw_curio_candidates = 85 +game/core/adventure_runner.gd|quality/max-function-length|_start_current_level = 53 +game/core/adventure_runner.gd|quality/max-function-length|resume_adventure = 108 +game/core/adventure_runner.gd|quality/max-local-variables|_draw_curio_candidates = 26 +game/core/adventure_runner.gd|quality/max-local-variables|resume_adventure = 13 +game/core/adventure_runner.gd|quality/max-public-methods = 23 +game/core/adventure_runner.gd|quality/max-returns|_apply_curio_pick = 9 +game/core/battle_orchestrator.gd|quality/max-branches|begin_battle = 17 +game/core/battle_orchestrator.gd|quality/max-branches|use_treasure = 18 +game/core/battle_orchestrator.gd|quality/max-class-variables = 50 +game/core/battle_orchestrator.gd|quality/max-file-length = 1302 +game/core/battle_orchestrator.gd|quality/max-function-length|_place_variants = 52 +game/core/battle_orchestrator.gd|quality/max-function-length|begin_battle = 141 +game/core/battle_orchestrator.gd|quality/max-function-length|use_treasure = 62 +game/core/battle_orchestrator.gd|quality/max-local-variables|_place_variants = 14 +game/core/battle_orchestrator.gd|quality/max-local-variables|begin_battle = 16 +game/core/battle_orchestrator.gd|quality/max-local-variables|use_treasure = 11 +game/core/battle_orchestrator.gd|quality/max-nesting-depth|_place_variants = 6 +game/core/battle_orchestrator.gd|quality/max-parameters|_apply_flat_row = 7 +game/core/battle_orchestrator.gd|quality/max-parameters|_apply_gp_row = 6 +game/core/battle_orchestrator.gd|quality/max-parameters|_apply_percent_row = 6 +game/core/battle_orchestrator.gd|quality/max-parameters|_dispatch_row = 6 +game/core/battle_orchestrator.gd|quality/max-parameters|_emit_row = 8 +game/core/battle_orchestrator.gd|quality/max-parameters|_grant_routed = 8 +game/core/battle_orchestrator.gd|quality/max-parameters|_submit_flat_hero = 7 +game/core/battle_orchestrator.gd|quality/max-returns|_apply_flat_row = 9 +game/core/battle_orchestrator.gd|quality/max-returns|_fx_fact = 7 +game/core/battle_orchestrator.gd|quality/max-returns|begin_battle = 7 +game/core/battle_orchestrator.gd|quality/max-returns|use_treasure = 8 +game/core/board_generator.gd|quality/max-branches|measure_inferability = 12 +game/core/board_generator.gd|quality/max-function-length|_attempt = 51 +game/core/board_generator.gd|quality/max-function-length|generate = 62 +game/core/board_generator.gd|quality/max-function-length|measure_inferability = 64 +game/core/board_generator.gd|quality/max-local-variables|generate = 14 +game/core/board_generator.gd|quality/max-local-variables|measure_inferability = 13 +game/core/board_generator.gd|quality/max-nesting-depth|measure_inferability = 5 +game/core/board_generator.gd|quality/max-parameters|_finalize = 6 +game/core/config_db.gd|quality/max-class-variables = 25 +game/core/config_db.gd|quality/max-public-methods = 44 +game/core/config_db_cross_validator.gd|quality/max-branches|cross_validate = 21 +game/core/config_db_cross_validator.gd|quality/max-function-length|cross_validate = 107 +game/core/config_db_cross_validator.gd|quality/max-local-variables|cross_validate = 24 +game/core/config_db_cross_validator.gd|quality/max-local-variables|validate_skill_pool_links = 11 +game/core/config_db_cross_validator.gd|quality/max-nesting-depth|cross_validate = 5 +game/core/config_db_resolver.gd|quality/max-branches|_resolve_progress = 16 +game/core/config_db_resolver.gd|quality/max-branches|resolve_enemy_rowset = 12 +game/core/config_db_resolver.gd|quality/max-function-length|_resolve_progress = 52 +game/core/config_db_resolver.gd|quality/max-local-variables|_resolve_progress = 11 +game/core/damage_controller.gd|quality/max-branches|_hero_attack_ctx = 9 +game/core/damage_controller.gd|quality/max-branches|_hero_attack_redeem = 10 +game/core/damage_controller.gd|quality/max-class-variables = 19 +game/core/damage_controller.gd|quality/max-function-length|_hero_attack_ctx = 61 +game/core/damage_controller.gd|quality/max-function-length|_hero_attack_redeem = 54 +game/core/damage_controller.gd|quality/max-local-variables|_hero_attack_ctx = 16 +game/core/damage_controller.gd|quality/max-local-variables|_hero_attack_redeem = 12 +game/core/damage_controller.gd|quality/max-local-variables|_resolve_enemy_skill = 13 +game/core/damage_controller.gd|quality/max-parameters|open_ticket = 12 +game/core/effect_engine.gd|quality/max-branches|validate_trigger_row = 14 +game/core/effect_engine.gd|quality/max-function-length|_cond_ok = 52 +game/core/effect_engine.gd|quality/max-function-length|rebuild = 55 +game/core/effect_engine.gd|quality/max-local-variables|validate_trigger_row = 11 +game/core/effect_engine.gd|quality/max-nesting-depth|_cond_ok = 5 +game/core/effect_engine.gd|quality/max-nesting-depth|rebuild = 5 +game/core/effect_engine.gd|quality/max-returns|_cond_ok = 19 game/core/effect_engine.gd|quality/no-else-return|unnecessary 'elif' after 'return' -game/core/level_runner.gd|quality/max-class-variables|class has 38 variables (max 15) -game/core/level_runner.gd|quality/max-parameters|function 'start_level_external' has 7 parameters (max 5) -game/core/level_runner.gd|quality/max-public-methods|class has 54 public methods (max 20) -game/core/level_runner.gd|quality/max-returns|function '_enter_node' has 7 return statements (max 6) -game/core/meta_progression.gd|quality/max-public-methods|class has 31 public methods (max 20) -game/core/meta_progression.gd|quality/max-returns|function 'tree_can_buy' has 8 return statements (max 6) -game/core/minesweeper_rules.gd|quality/max-function-length|function '_do_dig' is 53 lines long (max 50) -game/core/node_map_generator.gd|quality/max-branches|function '_assign_types' has 11 branches (max 8) -game/core/node_map_generator.gd|quality/max-branches|function 'check_params' has 12 branches (max 8) -game/core/node_map_generator.gd|quality/max-branches|function 'validate_output' has 34 branches (max 8) -game/core/node_map_generator.gd|quality/max-function-length|function 'validate_output' is 132 lines long (max 50) -game/core/node_map_generator.gd|quality/max-local-variables|function '_add_forks' has 12 local variables (max 10) -game/core/node_map_generator.gd|quality/max-local-variables|function '_build' has 15 local variables (max 10) -game/core/node_map_generator.gd|quality/max-local-variables|function 'validate_output' has 22 local variables (max 10) -game/core/node_map_generator.gd|quality/max-nesting-depth|function '_check_fork_rules' has nesting depth 5 (max 4) -game/core/node_map_generator.gd|quality/max-returns|function 'validate_output' has 7 return statements (max 6) -game/core/reward_economy.gd|quality/max-function-length|function 'roll_board' is 54 lines long (max 50) -game/core/reward_economy.gd|quality/max-local-variables|function '_skewed_cell_rows' has 13 local variables (max 10) -game/core/reward_economy.gd|quality/max-local-variables|function 'roll_board' has 11 local variables (max 10) -game/core/save_manager.gd|quality/max-public-methods|class has 52 public methods (max 20) -game/core/save_manager.gd|quality/max-returns|function '_peek_summary_at' has 7 return statements (max 6) -game/core/save_manager.gd|quality/max-returns|function 'load_from_disk' has 8 return statements (max 6) -game/core/settlement/combat_segment.gd|quality/max-function-length|function 'run' is 83 lines long (max 50) -game/core/settlement/combat_segment.gd|quality/max-local-variables|function 'run' has 13 local variables (max 10) -game/core/settlement/grant_segment.gd|quality/max-branches|function '_judge_seal' has 14 branches (max 8) -game/core/settlement/grant_segment.gd|quality/max-branches|function 'run' has 33 branches (max 8) -game/core/settlement/grant_segment.gd|quality/max-function-length|function '_judge_seal' is 84 lines long (max 50) -game/core/settlement/grant_segment.gd|quality/max-function-length|function 'run' is 211 lines long (max 50) -game/core/settlement/grant_segment.gd|quality/max-local-variables|function '_judge_seal' has 11 local variables (max 10) -game/core/settlement/grant_segment.gd|quality/max-local-variables|function 'run' has 36 local variables (max 10) -game/core/settlement/grant_segment.gd|quality/max-nesting-depth|function '_judge_seal' has nesting depth 6 (max 4) -game/core/settlement/grant_segment.gd|quality/max-nesting-depth|function 'run' has nesting depth 6 (max 4) -game/core/status_container.gd|quality/max-nesting-depth|function 'apply_effect' has nesting depth 5 (max 4) -game/core/status_container.gd|quality/max-parameters|function '_new_instance' has 7 parameters (max 5) -game/core/status_container.gd|quality/max-returns|function 'apply_effect' has 9 return statements (max 6) -game/core/treasure_items.gd|quality/max-branches|function 'validate_use' has 11 branches (max 8) -game/core/treasure_items.gd|quality/max-nesting-depth|function 'validate_use' has nesting depth 5 (max 4) -game/core/unit_container.gd|quality/max-function-length|function 'spawn' is 81 lines long (max 50) -game/core/unit_container.gd|quality/max-local-variables|function 'spawn' has 17 local variables (max 10) -game/core/unit_container.gd|quality/max-parameters|function 'spawn' has 10 parameters (max 5) -game/data/schemas/adventure_table.gd|quality/max-class-variables|class has 44 variables (max 15) -game/data/schemas/board_gen_table.gd|quality/max-branches|function 'validate' has 20 branches (max 8) -game/data/schemas/board_gen_table.gd|quality/max-function-length|function 'validate' is 67 lines long (max 50) -game/data/schemas/board_gen_table.gd|quality/max-local-variables|function 'validate' has 16 local variables (max 10) -game/data/schemas/enemy_table.gd|quality/max-branches|function 'validate' has 32 branches (max 8) -game/data/schemas/enemy_table.gd|quality/max-function-length|function 'validate' is 116 lines long (max 50) -game/data/schemas/enemy_table.gd|quality/max-local-variables|function 'validate' has 29 local variables (max 10) -game/data/schemas/forge_table.gd|quality/max-branches|function 'validate' has 30 branches (max 8) -game/data/schemas/forge_table.gd|quality/max-function-length|function 'validate' is 95 lines long (max 50) -game/data/schemas/forge_table.gd|quality/max-local-variables|function 'validate' has 20 local variables (max 10) -game/data/schemas/level_gen_params.gd|quality/max-branches|function 'validate' has 15 branches (max 8) -game/data/schemas/level_gen_params.gd|quality/max-function-length|function 'validate' is 59 lines long (max 50) -game/data/schemas/level_gen_params.gd|quality/max-local-variables|function 'validate' has 18 local variables (max 10) -game/data/schemas/meta_table.gd|quality/max-branches|function 'validate' has 14 branches (max 8) -game/data/schemas/meta_table.gd|quality/max-function-length|function 'validate' is 60 lines long (max 50) -game/data/schemas/meta_table.gd|quality/max-local-variables|function 'validate' has 14 local variables (max 10) -game/data/schemas/meta_tree_table.gd|quality/max-branches|function 'validate' has 26 branches (max 8) -game/data/schemas/meta_tree_table.gd|quality/max-function-length|function 'validate' is 86 lines long (max 50) -game/data/schemas/meta_tree_table.gd|quality/max-local-variables|function 'validate' has 13 local variables (max 10) -game/data/schemas/meta_tree_table.gd|quality/max-nesting-depth|function 'validate' has nesting depth 5 (max 4) -game/data/schemas/reward_table.gd|quality/max-branches|function 'validate' has 30 branches (max 8) -game/data/schemas/reward_table.gd|quality/max-function-length|function 'validate' is 99 lines long (max 50) -game/data/schemas/reward_table.gd|quality/max-local-variables|function 'validate' has 20 local variables (max 10) -game/data/schemas/settlement_table.gd|quality/max-branches|function 'validate' has 16 branches (max 8) -game/data/schemas/settlement_table.gd|quality/max-class-variables|class has 18 variables (max 15) -game/data/schemas/shop_table.gd|quality/max-branches|function 'validate' has 22 branches (max 8) -game/data/schemas/shop_table.gd|quality/max-function-length|function 'validate' is 84 lines long (max 50) -game/data/schemas/shop_table.gd|quality/max-local-variables|function 'validate' has 20 local variables (max 10) -game/data/schemas/skill_table.gd|quality/max-branches|function 'validate' has 29 branches (max 8) -game/data/schemas/skill_table.gd|quality/max-function-length|function 'validate' is 80 lines long (max 50) -game/data/schemas/status_effect_table.gd|quality/max-branches|function 'validate' has 12 branches (max 8) -game/data/schemas/treasure_item_table.gd|quality/max-branches|function 'validate' has 44 branches (max 8) -game/data/schemas/treasure_item_table.gd|quality/max-function-length|function 'validate' is 147 lines long (max 50) -game/data/schemas/treasure_item_table.gd|quality/max-local-variables|function 'validate' has 26 local variables (max 10) -game/data/schemas/treasure_item_table.gd|quality/max-nesting-depth|function 'validate' has nesting depth 6 (max 4) -game/data/schemas/variation_table.gd|quality/max-branches|function 'validate' has 20 branches (max 8) -game/data/schemas/variation_table.gd|quality/max-function-length|function 'validate' is 58 lines long (max 50) -game/presentation/battle_narrator.gd|quality/max-returns|function 'bonus_card_text' has 9 return statements (max 6) -game/presentation/camp_flow_context.gd|quality/max-parameters|function '_init' has 12 parameters (max 5) -game/presentation/curio_flow_context.gd|quality/max-class-variables|class has 16 variables (max 15) -game/presentation/curio_flow_context.gd|quality/max-parameters|function '_init' has 16 parameters (max 5) -game/presentation/curio_interact_controller.gd|quality/max-class-variables|class has 18 variables (max 15) -game/presentation/hud_presenter.gd|quality/max-parameters|function '_refresh_out_of_battle' has 6 parameters (max 5) -game/presentation/hud_presenter.gd|quality/max-parameters|function 'refresh' has 8 parameters (max 5) -game/presentation/hud_presenter.gd|quality/max-parameters|function 'tune_sim_report' has 10 parameters (max 5) -game/presentation/main.gd|quality/max-class-variables|class has 49 variables (max 15) -game/presentation/main.gd|quality/max-file-length|file is 1507 lines long (max 1000) -game/presentation/main.gd|quality/max-function-length|function '_build_ui' is 189 lines long (max 50) +game/core/level_runner.gd|quality/max-class-variables = 38 +game/core/level_runner.gd|quality/max-parameters|start_level_external = 7 +game/core/level_runner.gd|quality/max-public-methods = 54 +game/core/level_runner.gd|quality/max-returns|_enter_node = 7 +game/core/meta_progression.gd|quality/max-public-methods = 31 +game/core/meta_progression.gd|quality/max-returns|tree_can_buy = 8 +game/core/minesweeper_rules.gd|quality/max-function-length|_do_dig = 53 +game/core/node_map_generator.gd|quality/max-branches|_assign_types = 11 +game/core/node_map_generator.gd|quality/max-branches|check_params = 12 +game/core/node_map_generator.gd|quality/max-branches|validate_output = 34 +game/core/node_map_generator.gd|quality/max-function-length|validate_output = 132 +game/core/node_map_generator.gd|quality/max-local-variables|_add_forks = 12 +game/core/node_map_generator.gd|quality/max-local-variables|_build = 15 +game/core/node_map_generator.gd|quality/max-local-variables|validate_output = 22 +game/core/node_map_generator.gd|quality/max-nesting-depth|_check_fork_rules = 5 +game/core/node_map_generator.gd|quality/max-returns|validate_output = 7 +game/core/reward_economy.gd|quality/max-function-length|roll_board = 54 +game/core/reward_economy.gd|quality/max-local-variables|_skewed_cell_rows = 13 +game/core/reward_economy.gd|quality/max-local-variables|roll_board = 11 +game/core/save_manager.gd|quality/max-public-methods = 52 +game/core/save_manager.gd|quality/max-returns|_peek_summary_at = 7 +game/core/save_manager.gd|quality/max-returns|load_from_disk = 8 +game/core/settlement/combat_segment.gd|quality/max-function-length|run = 83 +game/core/settlement/combat_segment.gd|quality/max-local-variables|run = 13 +game/core/settlement/grant_segment.gd|quality/max-branches|_judge_seal = 14 +game/core/settlement/grant_segment.gd|quality/max-branches|run = 33 +game/core/settlement/grant_segment.gd|quality/max-function-length|_judge_seal = 84 +game/core/settlement/grant_segment.gd|quality/max-function-length|run = 211 +game/core/settlement/grant_segment.gd|quality/max-local-variables|_judge_seal = 11 +game/core/settlement/grant_segment.gd|quality/max-local-variables|run = 36 +game/core/settlement/grant_segment.gd|quality/max-nesting-depth|_judge_seal = 6 +game/core/settlement/grant_segment.gd|quality/max-nesting-depth|run = 6 +game/core/status_container.gd|quality/max-nesting-depth|apply_effect = 5 +game/core/status_container.gd|quality/max-parameters|_new_instance = 7 +game/core/status_container.gd|quality/max-returns|apply_effect = 9 +game/core/treasure_items.gd|quality/max-branches|validate_use = 11 +game/core/treasure_items.gd|quality/max-nesting-depth|validate_use = 5 +game/core/unit_container.gd|quality/max-function-length|spawn = 81 +game/core/unit_container.gd|quality/max-local-variables|spawn = 17 +game/core/unit_container.gd|quality/max-parameters|spawn = 10 +game/data/schemas/adventure_table.gd|quality/max-class-variables = 44 +game/data/schemas/board_gen_table.gd|quality/max-branches|validate = 20 +game/data/schemas/board_gen_table.gd|quality/max-function-length|validate = 67 +game/data/schemas/board_gen_table.gd|quality/max-local-variables|validate = 16 +game/data/schemas/enemy_table.gd|quality/max-branches|validate = 32 +game/data/schemas/enemy_table.gd|quality/max-function-length|validate = 116 +game/data/schemas/enemy_table.gd|quality/max-local-variables|validate = 29 +game/data/schemas/forge_table.gd|quality/max-branches|validate = 30 +game/data/schemas/forge_table.gd|quality/max-function-length|validate = 95 +game/data/schemas/forge_table.gd|quality/max-local-variables|validate = 20 +game/data/schemas/level_gen_params.gd|quality/max-branches|validate = 15 +game/data/schemas/level_gen_params.gd|quality/max-function-length|validate = 59 +game/data/schemas/level_gen_params.gd|quality/max-local-variables|validate = 18 +game/data/schemas/meta_table.gd|quality/max-branches|validate = 14 +game/data/schemas/meta_table.gd|quality/max-function-length|validate = 60 +game/data/schemas/meta_table.gd|quality/max-local-variables|validate = 14 +game/data/schemas/meta_tree_table.gd|quality/max-branches|validate = 26 +game/data/schemas/meta_tree_table.gd|quality/max-function-length|validate = 86 +game/data/schemas/meta_tree_table.gd|quality/max-local-variables|validate = 13 +game/data/schemas/meta_tree_table.gd|quality/max-nesting-depth|validate = 5 +game/data/schemas/reward_table.gd|quality/max-branches|validate = 30 +game/data/schemas/reward_table.gd|quality/max-function-length|validate = 99 +game/data/schemas/reward_table.gd|quality/max-local-variables|validate = 20 +game/data/schemas/settlement_table.gd|quality/max-branches|validate = 16 +game/data/schemas/settlement_table.gd|quality/max-class-variables = 18 +game/data/schemas/shop_table.gd|quality/max-branches|validate = 22 +game/data/schemas/shop_table.gd|quality/max-function-length|validate = 84 +game/data/schemas/shop_table.gd|quality/max-local-variables|validate = 20 +game/data/schemas/skill_table.gd|quality/max-branches|validate = 29 +game/data/schemas/skill_table.gd|quality/max-function-length|validate = 80 +game/data/schemas/status_effect_table.gd|quality/max-branches|validate = 12 +game/data/schemas/treasure_item_table.gd|quality/max-branches|validate = 44 +game/data/schemas/treasure_item_table.gd|quality/max-function-length|validate = 147 +game/data/schemas/treasure_item_table.gd|quality/max-local-variables|validate = 26 +game/data/schemas/treasure_item_table.gd|quality/max-nesting-depth|validate = 6 +game/data/schemas/variation_table.gd|quality/max-branches|validate = 20 +game/data/schemas/variation_table.gd|quality/max-function-length|validate = 58 +game/presentation/battle_narrator.gd|quality/max-returns|bonus_card_text = 9 +game/presentation/camp_flow_context.gd|quality/max-parameters|_init = 12 +game/presentation/curio_flow_context.gd|quality/max-class-variables = 16 +game/presentation/curio_flow_context.gd|quality/max-parameters|_init = 16 +game/presentation/curio_interact_controller.gd|quality/max-class-variables = 18 +game/presentation/hud_presenter.gd|quality/max-parameters|_refresh_out_of_battle = 6 +game/presentation/hud_presenter.gd|quality/max-parameters|refresh = 8 +game/presentation/hud_presenter.gd|quality/max-parameters|tune_sim_report = 10 +game/presentation/main.gd|quality/max-class-variables = 49 +game/presentation/main.gd|quality/max-file-length = 1507 +game/presentation/main.gd|quality/max-function-length|_build_ui = 189 game/presentation/playtest_logger.gd|quality/no-debug-print|debug 'print()' call found -game/presentation/treasure_interact_controller.gd|quality/max-local-variables|function 'inventory_projection' has 11 local variables (max 10) -game/presentation/treasure_interact_controller.gd|quality/max-parameters|function '_init' has 7 parameters (max 5) +game/presentation/treasure_interact_controller.gd|quality/max-local-variables|inventory_projection = 11 +game/presentation/treasure_interact_controller.gd|quality/max-parameters|_init = 7 game/presentation/tune_sim_controller.gd|quality/await-in-loop|'await' used inside a loop -game/presentation/tune_sim_controller.gd|quality/max-local-variables|function 'run' has 11 local variables (max 10) +game/presentation/tune_sim_controller.gd|quality/max-local-variables|run = 11 game/presentation/tune_sim_controller.gd|quality/no-debug-print|debug 'print()' call found game/presentation/ui_assembler.gd|quality/allocation-in-loop|object allocation '.new()' inside a loop -game/presentation/ui_assembler.gd|quality/max-function-length|function 'build_start_overlay' is 83 lines long (max 50) -game/presentation/ui_assembler.gd|quality/max-local-variables|function 'build_start_overlay' has 16 local variables (max 10) -game/presentation/views/ap_bar_view.gd|quality/max-function-length|function '_init' is 69 lines long (max 50) +game/presentation/ui_assembler.gd|quality/max-function-length|build_start_overlay = 83 +game/presentation/ui_assembler.gd|quality/max-local-variables|build_start_overlay = 16 +game/presentation/views/ap_bar_view.gd|quality/max-function-length|_init = 69 game/presentation/views/battle_end_overlay.gd|quality/allocation-in-loop|object allocation '.new()' inside a loop -game/presentation/views/battle_end_overlay.gd|quality/max-class-variables|class has 20 variables (max 15) -game/presentation/views/battle_end_overlay.gd|quality/max-function-length|function '_init' is 81 lines long (max 50) -game/presentation/views/battle_end_overlay.gd|quality/max-parameters|function 'open_victory' has 8 parameters (max 5) -game/presentation/views/battle_log_view.gd|quality/max-branches|function '_format_row' has 9 branches (max 8) -game/presentation/views/battle_log_view.gd|quality/max-function-length|function '_format_row' is 68 lines long (max 50) -game/presentation/views/battle_log_view.gd|quality/max-local-variables|function '_format_row' has 21 local variables (max 10) -game/presentation/views/battle_log_view.gd|quality/max-returns|function '_format_row' has 13 return statements (max 6) +game/presentation/views/battle_end_overlay.gd|quality/max-class-variables = 20 +game/presentation/views/battle_end_overlay.gd|quality/max-function-length|_init = 81 +game/presentation/views/battle_end_overlay.gd|quality/max-parameters|open_victory = 8 +game/presentation/views/battle_log_view.gd|quality/max-branches|_format_row = 9 +game/presentation/views/battle_log_view.gd|quality/max-function-length|_format_row = 68 +game/presentation/views/battle_log_view.gd|quality/max-local-variables|_format_row = 21 +game/presentation/views/battle_log_view.gd|quality/max-returns|_format_row = 13 game/presentation/views/battle_stage_view.gd|quality/allocation-in-loop|object allocation '.new()' inside a loop -game/presentation/views/battle_stage_view.gd|quality/max-function-length|function '_init' is 97 lines long (max 50) -game/presentation/views/battle_stage_view.gd|quality/max-returns|function '_enemy_portrait_tex' has 9 return statements (max 6) -game/presentation/views/board_cell_unit.gd|quality/max-branches|function '_draw' has 29 branches (max 8) -game/presentation/views/board_cell_unit.gd|quality/max-class-variables|class has 31 variables (max 15) -game/presentation/views/board_cell_unit.gd|quality/max-function-length|function '_draw' is 147 lines long (max 50) -game/presentation/views/board_cell_unit.gd|quality/max-local-variables|function '_draw' has 19 local variables (max 10) +game/presentation/views/battle_stage_view.gd|quality/max-function-length|_init = 97 +game/presentation/views/battle_stage_view.gd|quality/max-returns|_enemy_portrait_tex = 9 +game/presentation/views/board_cell_unit.gd|quality/max-branches|_draw = 29 +game/presentation/views/board_cell_unit.gd|quality/max-class-variables = 31 +game/presentation/views/board_cell_unit.gd|quality/max-function-length|_draw = 147 +game/presentation/views/board_cell_unit.gd|quality/max-local-variables|_draw = 19 game/presentation/views/board_fx_view.gd|quality/allocation-in-loop|object allocation '.new()' inside a loop game/presentation/views/board_view.gd|quality/allocation-in-loop|object allocation '.new()' inside a loop -game/presentation/views/board_view.gd|quality/max-branches|function '_paint_cell' has 24 branches (max 8) -game/presentation/views/board_view.gd|quality/max-branches|function '_wall_tile_for' has 14 branches (max 8) -game/presentation/views/board_view.gd|quality/max-class-variables|class has 45 variables (max 15) -game/presentation/views/board_view.gd|quality/max-file-length|file is 1220 lines long (max 1000) -game/presentation/views/board_view.gd|quality/max-function-length|function '_paint_cell' is 139 lines long (max 50) -game/presentation/views/board_view.gd|quality/max-local-variables|function '_digit_ink_mode' has 12 local variables (max 10) -game/presentation/views/board_view.gd|quality/max-local-variables|function '_paint_cell' has 22 local variables (max 10) -game/presentation/views/board_view.gd|quality/max-public-methods|class has 27 public methods (max 20) -game/presentation/views/board_view.gd|quality/max-returns|function '_wall_center_tile' has 7 return statements (max 6) -game/presentation/views/board_view.gd|quality/max-returns|function '_wall_tile_for' has 15 return statements (max 6) -game/presentation/views/board_zone_view.gd|quality/max-function-length|function '_init' is 59 lines long (max 50) +game/presentation/views/board_view.gd|quality/max-branches|_paint_cell = 24 +game/presentation/views/board_view.gd|quality/max-branches|_wall_tile_for = 14 +game/presentation/views/board_view.gd|quality/max-class-variables = 45 +game/presentation/views/board_view.gd|quality/max-file-length = 1220 +game/presentation/views/board_view.gd|quality/max-function-length|_paint_cell = 139 +game/presentation/views/board_view.gd|quality/max-local-variables|_digit_ink_mode = 12 +game/presentation/views/board_view.gd|quality/max-local-variables|_paint_cell = 22 +game/presentation/views/board_view.gd|quality/max-public-methods = 27 +game/presentation/views/board_view.gd|quality/max-returns|_wall_center_tile = 7 +game/presentation/views/board_view.gd|quality/max-returns|_wall_tile_for = 15 +game/presentation/views/board_zone_view.gd|quality/max-function-length|_init = 59 game/presentation/views/camp_overlay_view.gd|quality/allocation-in-loop|object allocation '.new()' inside a loop -game/presentation/views/camp_overlay_view.gd|quality/max-class-variables|class has 19 variables (max 15) -game/presentation/views/camp_overlay_view.gd|quality/max-function-length|function '_init' is 149 lines long (max 50) -game/presentation/views/camp_overlay_view.gd|quality/max-function-length|function '_rebuild_forge' is 72 lines long (max 50) -game/presentation/views/camp_overlay_view.gd|quality/max-function-length|function '_rebuild_tree' is 61 lines long (max 50) -game/presentation/views/camp_overlay_view.gd|quality/max-function-length|function 'refresh_camp' is 61 lines long (max 50) -game/presentation/views/camp_overlay_view.gd|quality/max-local-variables|function '_init' has 28 local variables (max 10) -game/presentation/views/camp_overlay_view.gd|quality/max-local-variables|function '_rebuild_forge' has 20 local variables (max 10) -game/presentation/views/camp_overlay_view.gd|quality/max-local-variables|function '_rebuild_tree' has 21 local variables (max 10) -game/presentation/views/camp_overlay_view.gd|quality/max-local-variables|function 'refresh_camp' has 17 local variables (max 10) -game/presentation/views/curio_pick_overlay.gd|quality/max-function-length|function '_init' is 52 lines long (max 50) -game/presentation/views/curio_pick_overlay.gd|quality/max-returns|function '_icon_for_id' has 7 return statements (max 6) -game/presentation/views/debug_overlay.gd|quality/max-class-variables|class has 17 variables (max 15) -game/presentation/views/debug_overlay.gd|quality/max-function-length|function '_build' is 124 lines long (max 50) -game/presentation/views/debug_overlay.gd|quality/max-local-variables|function '_build' has 22 local variables (max 10) +game/presentation/views/camp_overlay_view.gd|quality/max-class-variables = 19 +game/presentation/views/camp_overlay_view.gd|quality/max-function-length|_init = 149 +game/presentation/views/camp_overlay_view.gd|quality/max-function-length|_rebuild_forge = 72 +game/presentation/views/camp_overlay_view.gd|quality/max-function-length|_rebuild_tree = 61 +game/presentation/views/camp_overlay_view.gd|quality/max-function-length|refresh_camp = 61 +game/presentation/views/camp_overlay_view.gd|quality/max-local-variables|_init = 28 +game/presentation/views/camp_overlay_view.gd|quality/max-local-variables|_rebuild_forge = 20 +game/presentation/views/camp_overlay_view.gd|quality/max-local-variables|_rebuild_tree = 21 +game/presentation/views/camp_overlay_view.gd|quality/max-local-variables|refresh_camp = 17 +game/presentation/views/curio_pick_overlay.gd|quality/max-function-length|_init = 52 +game/presentation/views/curio_pick_overlay.gd|quality/max-returns|_icon_for_id = 7 +game/presentation/views/debug_overlay.gd|quality/max-class-variables = 17 +game/presentation/views/debug_overlay.gd|quality/max-function-length|_build = 124 +game/presentation/views/debug_overlay.gd|quality/max-local-variables|_build = 22 game/presentation/views/hero_info_panel_view.gd|quality/allocation-in-loop|object allocation '.new()' inside a loop -game/presentation/views/hero_info_panel_view.gd|quality/max-function-length|function '_init' is 74 lines long (max 50) -game/presentation/views/hero_info_panel_view.gd|quality/max-function-length|function 'set_treasure_inventory' is 57 lines long (max 50) -game/presentation/views/hero_info_panel_view.gd|quality/max-local-variables|function 'set_treasure_inventory' has 13 local variables (max 10) +game/presentation/views/hero_info_panel_view.gd|quality/max-function-length|_init = 74 +game/presentation/views/hero_info_panel_view.gd|quality/max-function-length|set_treasure_inventory = 57 +game/presentation/views/hero_info_panel_view.gd|quality/max-local-variables|set_treasure_inventory = 13 game/presentation/views/legend_overlay.gd|quality/allocation-in-loop|object allocation '.new()' inside a loop -game/presentation/views/level_map_screen.gd|quality/max-branches|function '_draw_graph' has 9 branches (max 8) -game/presentation/views/level_map_screen.gd|quality/max-class-variables|class has 21 variables (max 15) -game/presentation/views/level_map_screen.gd|quality/max-function-length|function '_draw_graph' is 78 lines long (max 50) -game/presentation/views/level_map_screen.gd|quality/max-function-length|function '_init' is 135 lines long (max 50) -game/presentation/views/level_map_screen.gd|quality/max-local-variables|function '_draw_graph' has 27 local variables (max 10) -game/presentation/views/level_map_screen.gd|quality/max-local-variables|function '_init' has 21 local variables (max 10) -game/presentation/views/settings_overlay.gd|quality/max-function-length|function '_build' is 77 lines long (max 50) -game/presentation/views/settings_overlay.gd|quality/max-local-variables|function '_build' has 13 local variables (max 10) +game/presentation/views/level_map_screen.gd|quality/max-branches|_draw_graph = 9 +game/presentation/views/level_map_screen.gd|quality/max-class-variables = 21 +game/presentation/views/level_map_screen.gd|quality/max-function-length|_draw_graph = 78 +game/presentation/views/level_map_screen.gd|quality/max-function-length|_init = 135 +game/presentation/views/level_map_screen.gd|quality/max-local-variables|_draw_graph = 27 +game/presentation/views/level_map_screen.gd|quality/max-local-variables|_init = 21 +game/presentation/views/settings_overlay.gd|quality/max-function-length|_build = 77 +game/presentation/views/settings_overlay.gd|quality/max-local-variables|_build = 13 game/presentation/views/standee_body.gd|quality/allocation-in-loop|object allocation '.new()' inside a loop -game/presentation/views/standee_body.gd|quality/max-class-variables|class has 29 variables (max 15) -game/presentation/views/standee_body.gd|quality/max-function-length|function '_draw' is 84 lines long (max 50) -game/presentation/views/standee_body.gd|quality/max-local-variables|function '_draw' has 26 local variables (max 10) -game/presentation/views/ui_kit.gd|quality/max-local-variables|function 'beams_rect' has 13 local variables (max 10) -game/presentation/views/ui_kit.gd|quality/max-parameters|function '_init' has 6 parameters (max 5) -game/presentation/views/ui_kit.gd|quality/max-parameters|function 'bcard' has 6 parameters (max 5) -game/presentation/views/ui_kit.gd|quality/max-parameters|function 'modal_shell' has 6 parameters (max 5) -game/presentation/views/ui_kit.gd|quality/max-public-methods|class has 26 public methods (max 20) +game/presentation/views/standee_body.gd|quality/max-class-variables = 29 +game/presentation/views/standee_body.gd|quality/max-function-length|_draw = 84 +game/presentation/views/standee_body.gd|quality/max-local-variables|_draw = 26 +game/presentation/views/ui_kit.gd|quality/max-local-variables|beams_rect = 13 +game/presentation/views/ui_kit.gd|quality/max-parameters|_init = 6 +game/presentation/views/ui_kit.gd|quality/max-parameters|bcard = 6 +game/presentation/views/ui_kit.gd|quality/max-parameters|modal_shell = 6 +game/presentation/views/ui_kit.gd|quality/max-public-methods = 26 diff --git a/tools/gdstyle_gate.py b/tools/gdstyle_gate.py index ad89025b..70c4e922 100644 --- a/tools/gdstyle_gate.py +++ b/tools/gdstyle_gate.py @@ -3,24 +3,36 @@ """gdstyle_gate.py — S13 第三方质量规则闸件(game/tests/static_scan.sh 调用) 跑 gdstyle(github.com/atelico/gdstyle,Rust 单二进制,版本钉 v0.4.0)质量规则扫描, -与存量基线 tools/gdstyle_baseline.txt 做差集——只有基线外的新违规才红。 -规则口径见 tools/gdstyle.toml 头注(只开 quality/*+syntax/reserved-identifier, -format/naming/order 全关)。扫描面=产品码三目录(game/core、game/data、game/presentation, -与 S9 类型闸同口径——probe/sim/tests 测量面直构惯例不在面)。 +与存量基线 tools/gdstyle_baseline.txt 对账。规则口径见 tools/gdstyle.toml 头注(只开 +quality/*+syntax/reserved-identifier,format/naming/order 全关)。扫描面=产品码三目录 +(game/core、game/data、game/presentation,与 S9 类型闸同口径——probe/sim/tests 测量面 +直构惯例不在面)。 -基线键=文件|规则|消息 三元组:消息含违规对象标识(如 duplicated load 的路径),行漂移稳定 -(gdstyle 的 JSON 输出不含源码行文本,行号键会随编辑成片假红)。基线重生成=人工专用 -(--refresh),禁在闸内自动重生成(防清基线换绿)。 +基线键=稳定身份键(消息里的行数/分支数/变量数等计数漂移不再换键,存量债改小不假红): + 函数级带数条目 键=文件|规则|函数名(函数名取自消息 function 'x' 段); + 类级/文件级带数条目(class variables/public methods/file length) + 键=文件|规则; + 无数字条目 键=文件|规则|消息全文(消息本身稳定,保留第三段避免同文件同规则多条互吞)。 +带数条目行格式「键 = 数值」,数值=消息剥掉 (max N) 段后首个整数;无数字条目裸键无数值。 +判定:①键不在基线=新违规(NEW)红;②键在基线且双方有数值、当前数值 > 基线登记值= +恶化(WORSENED)红——独立于差集,防稳定键吞掉 104→300 行式恶化;③其余绿(改小/持平不红)。 + +基线重生成=人工专用(--refresh,附新旧对账与骤降守卫),禁在闸内自动重生成(防清基线换绿); +新键数较旧基线少逾 10% 时拒绝写入,须加 --force 显式确认(防扫面断裂静默缩基线换绿), +--force 只在 refresh 路径有效。 二进制:本机固定路径 D:/code/gdstyle/gdstyle.exe(不入库不入包),GDSTYLE_BIN 环境变量覆盖; 版本与钉定版不符即红——升级工具须重测语法兼容性并人工重生成基线。 -退出码:0=无基线外新违规;1=有新违规/二进制缺失或版本不符/扫描面为空/输出不可解析;2=用法错。 -用法:python tools/gdstyle_gate.py # 闸判定 - python tools/gdstyle_gate.py --refresh # 人工重生成基线(覆盖旧文件) +退出码:0=无基线外新违规且无恶化;1=有新违规/有恶化/二进制缺失或版本不符/扫描面为空/ +输出不可解析/refresh 骤降拒写;2=用法错。 +用法:python tools/gdstyle_gate.py # 闸判定 + python tools/gdstyle_gate.py --refresh # 人工重生成基线(覆盖旧文件,附对账) + python tools/gdstyle_gate.py --refresh --force # 骤降守卫触发时显式确认写入 """ import json import os +import re import subprocess import sys from pathlib import Path @@ -32,6 +44,12 @@ SCAN_DIRS = ["game/core", "game/data", "game/presentation"] PINNED_VERSION = "0.4.0" DEFAULT_BIN = "D:/code/gdstyle/gdstyle.exe" MAX_REPORT = 50 +MAX_VANISHED_REPORT = 20 +SHRINK_GUARD = 0.9 # 新键数 < 旧键数 * 本系数=骤降,refresh 拒写须 --force + +_FUNC_RE = re.compile(r"function '([^']+)'") +_MAX_RE = re.compile(r"\s*\(max \d+\)") +_INT_RE = re.compile(r"\d+") def fail(msg: str) -> int: @@ -39,13 +57,77 @@ def fail(msg: str) -> int: return 1 +def build_entry(finding: dict): + """finding dict -> (key, value|None)。数值=消息剥掉 (max N) 段后首个整数。""" + file_path = str(finding.get("file", "")).replace("\\", "/") + rule = str(finding.get("rule", "")) + msg = str(finding.get("message", "")) + m = _INT_RE.search(_MAX_RE.sub("", msg)) + value = int(m.group()) if m else None + fm = _FUNC_RE.search(msg) + if fm: + key = "%s|%s|%s" % (file_path, rule, fm.group(1)) + elif value is not None: + key = "%s|%s" % (file_path, rule) + else: + key = "%s|%s|%s" % (file_path, rule, msg) + return key, value + + +def collect_entries(findings) -> dict: + """扫描结果 -> {键: 数值|None};同键多条取较大数值(恶化侧保守)。""" + entries = {} + for f in findings: + if not isinstance(f, dict) or "rule" not in f: + continue + key, value = build_entry(f) + if key in entries and entries[key] is not None and value is not None: + value = max(entries[key], value) + entries[key] = value + return entries + + +def parse_baseline() -> dict: + """基线文件 -> {键: 数值|None}。行「键 = 数字」解析为带数条目,其余整行为裸键。""" + entries = {} + for line in BASELINE.read_text(encoding="utf-8").splitlines(): + s = line.strip() + if not s or s.startswith("#"): + continue + key, value = s, None + if " = " in s: + k, _, v = s.rpartition(" = ") + if v.isdigit(): + key, value = k, int(v) + entries[key] = value + return entries + + +def write_baseline(entries: dict) -> None: + lines = [ + "# gdstyle 存量基线(S13)——键每行一条;只记基线不记豁免理由。", + "# 键形态(稳定身份键,计数漂移不换键):函数级带数条目=文件|规则|函数名;类级/文件级带数条目", + "# (class variables/public methods/file length)=文件|规则;无数字条目=文件|规则|消息全文(裸键)。", + "# 带数条目行格式「键 = 数值」,数值=消息剥掉 (max N) 段后首个整数;无数字条目裸键。", + "# 判定=键不在基线红(NEW)、同键数值较登记值恶化红(WORSENED)、改小/持平不红。", + "# 重生成=人工专用:python tools/gdstyle_gate.py --refresh(禁清基线换绿;改规则口径/工具升级须随批", + "# 重生成;新键数较旧基线少逾 10% 须加 --force 显式确认)。", + ] + for key in sorted(entries): + value = entries[key] + lines.append("%s = %d" % (key, value) if value is not None else key) + BASELINE.write_text("\n".join(lines) + "\n", encoding="utf-8") + + def run_gate() -> int: if hasattr(sys.stdout, "reconfigure"): sys.stdout.reconfigure(encoding="utf-8", errors="replace") - refresh = "--refresh" in sys.argv[1:] - if sys.argv[1:] and not refresh: - print("[gdstyle_gate] 用法: python tools/gdstyle_gate.py [--refresh]") + args = sys.argv[1:] + refresh = "--refresh" in args + force = "--force" in args + if (force and not refresh) or any(a not in ("--refresh", "--force") for a in args): + print("[gdstyle_gate] 用法: python tools/gdstyle_gate.py [--refresh] [--force](--force 只在 refresh 路径有效)") return 2 binary = os.environ.get("GDSTYLE_BIN", DEFAULT_BIN) @@ -74,41 +156,54 @@ def run_gate() -> int: except json.JSONDecodeError: return fail("gdstyle 输出不可解析为 JSON(stderr 头部:%r)" % (proc.stderr or "")[:200]) - keys = set() - for f in findings: - if not isinstance(f, dict) or "rule" not in f: - continue - file_path = str(f.get("file", "")).replace("\\", "/") - keys.add("%s|%s|%s" % (file_path, f["rule"], f.get("message", ""))) + current = collect_entries(findings) if refresh: - lines = [ - "# gdstyle 存量基线(S13)——文件|规则|消息 三元组,每行一条;只记基线不记豁免理由。", - "# 重生成=人工专用:python tools/gdstyle_gate.py --refresh(禁清基线换绿;改规则口径/工具升级须随批重生成)。", - ] - lines += sorted(keys) - BASELINE.write_text("\n".join(lines) + "\n", encoding="utf-8") - print("[gdstyle_gate] 基线已重生成:%s 条(%s)" % (len(keys), BASELINE.name)) + old = parse_baseline() if BASELINE.exists() else None + if old is not None: + vanished = sorted(set(old) - set(current)) + print("[gdstyle_gate] 对账:旧基线 %d 条,新扫描 %d 条,消失键 %d 条" + % (len(old), len(current), len(vanished))) + for k in vanished[:MAX_VANISHED_REPORT]: + print(" GONE " + k) + if len(vanished) > MAX_VANISHED_REPORT: + print(" ...(截断,共 %d 条)" % len(vanished)) + if len(current) < len(old) * SHRINK_GUARD and not force: + return fail("新键数 %d 较旧基线 %d 少逾 10%%——疑扫面断裂静默缩基线换绿,拒绝写入;" + "确认缩基线正当(如删规则/缩扫描面)须加 --force 显式确认" % (len(current), len(old))) + else: + print("[gdstyle_gate] 旧基线不存在,跳过对账(首次落位)") + write_baseline(current) + print("[gdstyle_gate] 基线已重生成:%s 条(%s)" % (len(current), BASELINE.name)) return 0 - base = set() - if BASELINE.exists(): - for line in BASELINE.read_text(encoding="utf-8").splitlines(): - s = line.strip() - if s and not s.startswith("#"): - base.add(s) - else: + base = parse_baseline() if BASELINE.exists() else {} + if not base and not BASELINE.exists(): return fail("基线文件不存在:%s(首次落位跑 python tools/gdstyle_gate.py --refresh,须经用户批准)" % BASELINE.name) - new = sorted(keys - base) - print("[gdstyle_gate] 扫描面 %d 个 .gd;命中 %d 条,基线内 %d 条,基线外新违规 %d 条" - % (len(face), len(keys), len(keys & base), len(new))) + new = sorted(k for k in current if k not in base) + worsened = sorted( + k for k in current + if k in base and current[k] is not None and base[k] is not None and current[k] > base[k] + ) + print("[gdstyle_gate] 扫描面 %d 个 .gd;命中 %d 条,基线内 %d 条,基线外新违规 %d 条,较登记值恶化 %d 条" + % (len(face), len(current), len(set(current) & set(base)), len(new), len(worsened))) + red = False if new: for k in new[:MAX_REPORT]: print(" NEW " + k) if len(new) > MAX_REPORT: print(" ...(截断,共 %d 条)" % len(new)) - return fail("基线外新违规 %d 条——新码须修到基线口径内,或经用户批准随批重生成基线" % len(new)) + red = True + if worsened: + for k in worsened[:MAX_REPORT]: + print(" WORSENED %s = %d(基线登记 %d)" % (k, current[k], base[k])) + if len(worsened) > MAX_REPORT: + print(" ...(截断,共 %d 条)" % len(worsened)) + red = True + if red: + return fail("基线外新违规 %d 条/恶化 %d 条——新码须修到基线口径内,恶化须还债或经用户批准随批重生成基线" + % (len(new), len(worsened))) print("[gdstyle_gate] ok") return 0