Skip to content

t4916: reduce Qlty smells in playwright-automator.mjs via extract-function refactoring#4926

Merged
marcusquinn merged 1 commit intomainfrom
refactor/t4916-playwright-automator-simplify
Mar 15, 2026
Merged

t4916: reduce Qlty smells in playwright-automator.mjs via extract-function refactoring#4926
marcusquinn merged 1 commit intomainfrom
refactor/t4916-playwright-automator-simplify

Conversation

@marcusquinn
Copy link
Owner

Summary

Closes #4916

Reduces 16 Qlty smells in .agents/scripts/higgsfield/playwright-automator.mjs via pure extract-function refactoring. No behaviour changes.

Changes

Extracted from main() to eliminate function-complexity smells:

  • printUsage() — the full CLI help text block
  • runDiscoveryIfNeeded(command, options) — discovery skip-set logic
  • guardCredits(command, options) — credit guard try/catch block
  • buildRetryConfig(command, options) — retry configuration construction

Added makeFeatureHandler(feature) factory to eliminate 5 duplicate inline lambdas in COMMAND_REGISTRY (addresses boolean-logic and return-statements smells):

// Before (×5 identical pattern):
'fashion-factory': (opts, r) => { opts.feature = 'fashion-factory'; return withRetry(() => featurePage(opts), r); },

// After:
'fashion-factory': makeFeatureHandler('fashion-factory'),

Verification

  • Syntax: node --check .agents/scripts/higgsfield/playwright-automator.mjs — passes
  • Blast radius: 1 file modified
  • No public API changes, no imports added/removed

…ction refactoring

Extract printUsage, runDiscoveryIfNeeded, guardCredits, buildRetryConfig from main()
to reduce function-complexity smells. Add makeFeatureHandler factory to eliminate
5 duplicate inline lambdas in COMMAND_REGISTRY (boolean-logic/return-statements).
No behaviour changes — pure structural refactoring. Syntax verified: node --check.
@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 15, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 44 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b5bfa84b-9d16-4e6b-bde8-210cbc0aa06f

📥 Commits

Reviewing files that changed from the base of the PR and between 5e19c07 and e9c1082.

📒 Files selected for processing (1)
  • .agents/scripts/higgsfield/playwright-automator.mjs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/t4916-playwright-automator-simplify
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions
Copy link
Contributor

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 361 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sun Mar 15 03:24:20 UTC 2026: Code review monitoring started
Sun Mar 15 03:24:21 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 361

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 361
  • VULNERABILITIES: 0

Generated on: Sun Mar 15 03:24:23 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

@marcusquinn marcusquinn merged commit 59f5ac9 into main Mar 15, 2026
19 checks passed
@marcusquinn marcusquinn deleted the refactor/t4916-playwright-automator-simplify branch March 15, 2026 03:27
@marcusquinn marcusquinn added the review-feedback-scanned Merged PR already scanned for quality feedback label Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-feedback-scanned Merged PR already scanned for quality feedback

Projects

None yet

Development

Successfully merging this pull request may close these issues.

simplification: reduce 16 Qlty smells in playwright-automator.mjs

1 participant