Skip to content

refactor: cognitive-complexity function limit 40, stage 2 of #1198 - #1200

Merged
s2x merged 6 commits into
masterfrom
refactor/issue-1198-cognitive-complexity-40
Nov 12, 2026
Merged

s2x merged 6 commits into
masterfrom
refactor/issue-1198-cognitive-complexity-40

Conversation

@s2x

@s2x s2x commented Nov 12, 2026

Copy link
Copy Markdown
Member

Description

Part of #1198 (stage 2: function limit 50 → 40, class stays 150).

Changes

  • ServerWorker::__construct() 48 → 1: each callback closure is returned by a private method; assignment order, $this/static binding, captured variables and onWorkerStart step order unchanged (verified side by side in review).
  • bin/kb-lint.php: parseFile() 41 → 0 (new KbFileParser), parseFrontMatter() 30 → 6, validateEntry() 31 → 1 — differential run old vs new: 1,224 runs, 0 differences.
  • tests/ServerWorkerTest.php +41 lines, no existing assertion removed: the body-size cap is now actually checked on the connection; new sweeper test for connections without context / lastActivity (mutation-checked).
  • Limit 40 in phpstan.neon.dist, gate test ceiling, CONTRIBUTING, CHANGELOG.

Changelog

Existing [Unreleased] → Changed entry for #1198 extended.

Proof of Work

docs/proof_of_work/1198-cognitive-complexity/ — code-decision-3.md, review-3.md (review-critical)

Code Review

  • Passed subagent code review
  • Every finding answered (R3-2 nit not done)

@s2x s2x self-assigned this Nov 12, 2026
@s2x
s2x merged commit 275a67a into master Nov 12, 2026
15 checks passed
@s2x
s2x deleted the refactor/issue-1198-cognitive-complexity-40 branch November 12, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant