refactor: burn down wave 4 — view templates, assertion equalizer, app-template request handling - #3439
Merged
Merged
Conversation
…3/30/30 to max 25)
debug.cfm 64, consoleeval.cfm 60, cfmlerror.cfm 34, mcp.cfm 33,
plugins.cfm 30, and command.cfm 30 — branchy data logic moved into local
$-prefixed functions in each file. Render markup byte-identical; verified
live: debug bar panels match baseline, plugins headings match, console eval
POST returns {TYPE:number, RESULT:5}, wheels migrate info works through the
command bridge. Fixes a #-escaping bug in the debug env-color extraction
(##dc3545 etc. — # interpolates in CFScript strings too) caught by hand-testing.
Signed-off-by: Peter Amiri <peter@alurium.com>
Six private $-prefixed helpers for the simple-value, query, array, struct, function, and XML comparison branches; pass/fail semantics and failure messages unchanged (model suite 979/0 exercises every expect() through it). Signed-off-by: Peter Amiri <peter@alurium.com>
…nRequestStart (44 to 4) Seven public $-prefixed helpers in the Application.cfc shipped by wheels new: content-only, debug-IP overrides, environment-switch detection, rate limiting, refusal recording, the fail-closed reload gate, and the restart path. The onboarding harness shows the identical 34/10/3 result with the original and the refactored template (the 10 failures are pre-existing environmental ones: migration empty-string-default hardening vs the harness fixture + sandbox denials). ReloadEnvironmentSwitchParitySpec: the two environment-switch source pins now accept both the inline shape and the delegated-helper shape (same guarantee — computed before the gate, gate skips on already-applied). Signed-off-by: Peter Amiri <peter@alurium.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fourth burn-down wave: the procedural view templates, the test-assertion equalizer, and the scaffolded Application.cfc template.
Before → after (cyclomatic complexity)
vendor/wheels now has ZERO functions over complexity 50 (max is 30); ≤10 functions rose to 2,468. The CLI tree's max is 26.
Approach
$-prefixed functions in the same file; the HTML markup stays byte-identical. Live-verified: debug-bar panels match the pre-change baseline, plugins headings match, console eval POST returns{TYPE:number, RESULT:5},wheels migrate infoworks through the command bridge.equalize: six private type helpers; everyexpect()in the suite flows through it (model suite 979/0).$-prefixed helpers (request guards, reload gate, restart path). The onboarding harness shows the identical 34/10/3 result with the original and the refactored template — the 10 failures are pre-existing environmental (migration empty-string-default hardening vs. the harness fixture + sandbox cache denials).Fixes made during verification
#-escaping: the debug-bar env-color extraction initially used single-#hex literals —#interpolates in CFScript strings too, which 500'd every page with the debug bar. Fixed to##dc3545etc.ReloadEnvironmentSwitchParitySpec's environment-switch source pins now accept both the inline shape and the delegated-helper shape (computed before the gate; gate skips when already applied).Verification
No changelog fragment: internal refactor, no user-facing change.