Skip to content

refactor(extension): end the buildState lizard artifact - #1367

Merged
rubenvdlinde merged 6 commits into
developmentfrom
refactor/ext-router-build-state
Nov 2, 2026
Merged

rubenvdlinde merged 6 commits into
developmentfrom
refactor/ext-router-build-state

Conversation

@rubenvdlinde

@rubenvdlinde rubenvdlinde commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

What changes

buildState() in the extension's background router writes the account limit check as MAX_ACCOUNTS > accounts.length instead of accounts.length < MAX_ACCOUNTS. This is a measurement fix. lizard read a < b, inside the object literal as the start of a type argument, so it counted buildState, add, reauthenticate and perform as one 107-line unit with McCabe 34. Sigrid's parser may not have this artifact.

Once the artifact is gone, add(serverUrl, username, appPassword) shows up as its own unit with 3 parameters, so params >=3 goes up 0.14 points. That is code the measurement used to hide, not a new parameter. Passing the message whole would mean touching perform(), which gate 122 would then count as a new McCabe >10 finding (11). So add() stays as it is.

SIG numbers (keepiq, TypeScript, lizard via gate 122)

check before after 4-star 5-star
CCN >25 6.29% 5.29% 1.1% 0.55%
CCN >10 21.23% 20.49% 7.3% 3.7%
size >60 5.32% 4.33% 8.3% met 4.2%
size >30 16.08% 15.39% 23.1% met 11.6%
params >=3 7.81% 7.95% 15% met 7.5%

How I verified it

  • src/background/router.test.ts passes (21 tests), including the empty-list case (canAddAccount: true) and the five-account case (false).
  • Capped mutants (vitest under NODE_OPTIONS=--max-old-space-size=1536 timeout 120) on the old and the new comparison: >=/<=, the flipped operator and a constant true all die on both. The no-op control survives on both.
  • eslint on the touched file is clean, and tsc --noEmit exits 0. Gate 122 ratchet: 0 findings, 1 inherited. Gate 119: 0.

Inherited

add() has 3 parameters.

perform() stays above McCabe 10 (11). Gate 122 reports it as inherited.

This change was prepared with Claude Code (AI assisted) and reviewed by a human before merge.

… buildState

Assisted-by: ClaudeCode:claude-opus-5-5
Changing the add() call touched perform(), which gate 122 then counts
as a new McCabe >10 finding.

Assisted-by: ClaudeCode:claude-opus-5-5
@rubenvdlinde rubenvdlinde changed the title refactor(extension): end the buildState lizard artifact and keep add() at one parameter refactor(extension): end the buildState lizard artifact Nov 1, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/keepiq @ 7d39249

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
test-l10n ✅
format ✅
check-l10n-js ✅
check-schema-l10n ✅
composer ✅ ✅ 114/114
npm ✅ ✅ 661/661
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ✅ 2797/2797 · 3 skipped
Newman ✅ 177/177 · 20 skipped
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ✅

Quality workflow — 2026-11-02 00:33 UTC

Download the full PDF report from the workflow artifacts.

active,
notice,
canAddAccount: accounts.length < MAX_ACCOUNTS,
canAddAccount: MAX_ACCOUNTS > accounts.length,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Minor — this changes the code to work around the measuring tool

MAX_ACCOUNTS > accounts.length behaves exactly like accounts.length < MAX_ACCOUNTS, but it is the less natural way to write the check, and the only reason for it is that lizard misreads a < b, inside an object literal as a type argument. Nothing here stops the next person from turning it back, and the description itself says Sigrid's parser may not have this problem. If the number matters, the fix belongs in the measurement (lizard's settings, or reading gate 122's result with this known artifact in mind), not in the extension's code.

@SudoThijn SudoThijn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: COMMENT (Thorough · full)

The swapped comparison behaves exactly as before, including the empty list and the five-account case. My one comment is about why it is there.

🟢 Minor (1)

CI: check-and-build fails on the SendRow date test that #1378 fixed, and e2e on the clipboard alarm test; neither is caused by this change.
Gates: Hydra Gates passed on c2a01177.

… the TOTP key work

#1352 (feature/browser-extension-7, merged as 87b34c1) added the
authenticator key field to logins, took totp out of the new-item types, and
added autoCopyTotp and totpSaved, after #1387 and #1389 had recorded these
goldens. Development's Browser extension check-and-build has been red since.
The totp options world now edits an existing totp item, because a new item
can no longer be one. Every other change in the recordings is the new field,
the dropped TOTP option, the two new values, or a shifted React id.

Assisted-by: ClaudeCode:claude-opus-5-5
@rubenvdlinde
rubenvdlinde merged commit d3e719f into development Nov 2, 2026
10 checks passed
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/keepiq @ a00eb5c

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
test-l10n ✅
format ✅
check-l10n-js ✅
check-schema-l10n ✅
composer ✅ ✅ 114/114
npm ✅ ✅ 661/661
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ✅ 2797/2797 · 3 skipped
Newman ✅ 177/177 · 20 skipped
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ✅

Quality workflow — 2026-11-03 01:56 UTC

Download the full PDF report from the workflow artifacts.

SudoThijn added a commit that referenced this pull request Nov 3, 2026
Address the review on #1367: buildState reads `accounts.length < MAX_ACCOUNTS` again.
The lizard misreading of `a < b,` in an object literal belongs in the measurement, not in the extension's code.
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.

2 participants