Skip to content

chore: reduce measured legacy code-health debt - #49

Merged
sarthakagrawal927 merged 1 commit into
mainfrom
fix/reduce-code-health-debt-42
Aug 15, 2026
Merged

chore: reduce measured legacy code-health debt#49
sarthakagrawal927 merged 1 commit into
mainfrom
fix/reduce-code-health-debt-42

Conversation

@sarthakagrawal927

@sarthakagrawal927 sarthakagrawal927 commented Aug 14, 2026

Copy link
Copy Markdown
Member

Summary

Targeted, behavior-preserving improvements to reduce measured code-health debt tracked by issue #42.

Changes

Lint warnings: 39 → 38

  • Remove unused Note import in src/lib/local-library.ts — the type was imported but never referenced.

Complexity violations: 37 → 35

  • Split isBlockedIp in src/lib/url-validation.ts into isBlockedIpv4 and isBlockedIpv6 helpers, with isBlockedIp as a thin dispatcher. The original function had CCN 22; the split functions are each well under the threshold. All existing SSRF tests pass unchanged.

Duplication: 37 → 32 groups, 493 → 413 lines

  • Consolidate ShareDialog and ArticleShareDialog into a shared ShareLinkDialog component (src/components/ui/ShareLinkDialog.tsx). The two original components were ~95% identical (differing only in API path, share URL prefix, and entity label). Both are now thin wrappers that preserve their existing props API — no caller changes needed.

Baselines lowered

  • scripts/check-code-health.mjs baselines updated to reflect the new measured values.

Validation

  • pnpm quality (full gate) passes: format, lint, typecheck, test:coverage, extension type-check/test/build, unused, complexity, duplication, cycles, dependencies, suppressions, docs:check, cf:build, hygiene.
  • All 96 existing tests pass.
  • No behavior or data changes.

Progress on #42

- Remove unused Note import in local-library.ts (lint warning 39→38)
- Split isBlockedIp into isBlockedIpv4/isBlockedIpv6 helpers (complexity violations 37→35)
- Consolidate ShareDialog and ArticleShareDialog into shared ShareLinkDialog (duplication 37→32 groups, 493→413 lines)
- Lower checked-in baselines to reflect improvements

Progress on #42
@cloudflare-workers-and-pages

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 Updated (UTC)
✅ Deployment successful!
View logs
reader 68d6223 Aug 14 2026, 08:56 PM

@sarthakagrawal927
sarthakagrawal927 merged commit 9ab3c4e into main Aug 15, 2026
2 checks passed
@sarthakagrawal927
sarthakagrawal927 deleted the fix/reduce-code-health-debt-42 branch August 15, 2026 07:11
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