Skip to content

refactor: lower cognitive complexity ceiling - #39

Merged
kjanat merged 7 commits into
masterfrom
reduce-cognitive-complexity
Jul 12, 2026
Merged

refactor: lower cognitive complexity ceiling#39
kjanat merged 7 commits into
masterfrom
reduce-cognitive-complexity

Conversation

@kjanat

@kjanat kjanat commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • lower Biome cognitive complexity limit to 20
  • extract focused helpers across validation, parsing, revocation, PKCS, docs, and tests without behavioral changes
  • keep OpenSSL differential checks and Zed TypeScript settings aligned

Verification

  • bun lint:biome
  • bun typecheck
  • bun test (1184 pass, 0 fail)

kjanat added 4 commits July 9, 2026 12:23
Split dense verification, revocation, parse, and PKITS harness paths into
smaller typed branches so lint complexity limits stop fighting core PKIX
behavior.
Split dense DER, PKCS, revocation, verify, parse, and docs paths
into smaller typed helpers so Biome can enforce a stricter cognitive
complexity limit.
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR decomposes internal DER, cryptographic, X.509, certificate-verification, CRL, OCSP, and documentation implementations into focused helpers. It also updates editor and linter settings, test harness gating, PKITS and OpenSSL utilities, and malformed-extension test reuse. Public APIs and exported signatures remain unchanged.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested labels: enhancement, tests

Poem

Arrr, tidy helpers sail the code,
DER and CRLs lighten their load.
OCSP charts a cleaner sea,
Tests guard every API.
No public signatures walk the plank!

🚥 Pre-merge checks | ✅ 4 | ❌ 4

❌ Failed checks (4 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.36% which is insufficient. The required threshold is 30.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Changelog Update ⚠️ Warning src/internal/verify/verify-path.ts changed, but CHANGELOG.md was not updated in the commit. Add an entry under ## [Unreleased] for the code changes, or if this is a release, add the new version header and links in CHANGELOG.md.
Semver Version Bump Validation ⚠️ Warning Source files changed in src/, but package.json stayed at 0.9.0 in both base and PR, so no SemVer bump was made. Bump the repo version in package.json (or another allowed version file) from 0.9.0 to the next SemVer release, e.g. 0.9.1.
Agents.Md Documentation Updated ⚠️ Warning src/internal/verify/verify-path.ts refactors internal verification architecture, but no matching src/internal/AGENTS.md change was included. Update src/internal/AGENTS.md to cover the new verification helper split and any responsibility/ownership changes in src/internal/verify/.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise, descriptive, and matches the refactor focus of the changeset.
Description check ✅ Passed The description clearly matches the PR’s refactor and configuration updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@kjanat kjanat self-assigned this Jul 12, 2026
@kjanat kjanat added the cr:review Allow CodeRabbit review label Jul 12, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/kjanat/micro509@39
pnpm add https://pkg.pr.new/kjanat/micro509@39
bun add https://pkg.pr.new/kjanat/micro509@39

commit: 1075af5

@codecov

This comment was marked as spam.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 12, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
micro509 1075af5 Commit Preview URL

Branch Preview URL
Jul 12 2026, 05:42 PM

@coderabbitai coderabbitai Bot added enhancement New feature or request tests Test coverage and harnesses labels Jul 12, 2026
coderabbitai[bot]

This comment was marked as resolved.

Keep `any` policy validation and empty-interface rendering intact,
reuse AKI comparison logic, and tighten affected regression checks.
coderabbitai[bot]

This comment was marked as resolved.

Keep expected trust-anchor verification failures in the signature result
ADT while allowing unexpected exceptions to propagate. Exercise `any`
policy handling with a policy-bearing chain.
@kjanat kjanat removed the cr:review Allow CodeRabbit review label Jul 12, 2026
Add focused helper JSDoc and update the changelog and knowledge files so
architecture ownership, validation guidance, and PR documentation checks
reflect the refactored structure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request tests Test coverage and harnesses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant