Skip to content

Fixes for 2 code quality findings#75

Merged
admdly merged 2 commits intomainfrom
ai-findings-autofix/test-utils-d1-mock.ts
Mar 17, 2026
Merged

Fixes for 2 code quality findings#75
admdly merged 2 commits intomainfrom
ai-findings-autofix/test-utils-d1-mock.ts

Conversation

@admdly
Copy link
Contributor

@admdly admdly commented Mar 17, 2026

This PR applies 2/2 suggestions from code quality AI findings.

admdly and others added 2 commits March 17, 2026 12:50
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@admdly admdly changed the title Potential fixes for 2 code quality findings Fixes for 2 code quality findings Mar 17, 2026
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 17, 2026

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
api-worker a8f2b87 Commit Preview URL

Branch Preview URL
Mar 17 2026, 12:51 PM

@admdly admdly marked this pull request as ready for review March 17, 2026 12:50
Copilot AI review requested due to automatic review settings March 17, 2026 12:50
@admdly admdly merged commit a6d32e1 into main Mar 17, 2026
9 checks passed
@admdly admdly deleted the ai-findings-autofix/test-utils-d1-mock.ts branch March 17, 2026 12:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR applies two code-quality suggestions to the test D1 database mock, aiming to simplify helper logic and standardize “not implemented” errors in the mock implementation.

Changes:

  • Simplifies the numeric extraction logic inside compareVersions.
  • Introduces a notImplementedInMock() helper to generate consistent error messages.
  • Replaces repeated “not implemented” error strings in MockD1Database methods with the shared helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 20 to +24
const length = Math.max(aParts.length, bParts.length);

for (let i = 0; i < length; i++) {
const aNum = Number.isNaN(aParts[i]) ? 0 : aParts[i] ?? 0;
const bNum = Number.isNaN(bParts[i]) ? 0 : bParts[i] ?? 0;
const aNum = aParts[i] ?? 0;
const bNum = bParts[i] ?? 0;
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