Skip to content

Refactor packages/core/src/ripgrep.ts complexity - #91

Open
leenalmeadadi wants to merge 2 commits into
CMU-17313Q:mainfrom
leenalmeadadi:refactor-ripgrep-complexity
Open

leenalmeadadi wants to merge 2 commits into
CMU-17313Q:mainfrom
leenalmeadadi:refactor-ripgrep-complexity

Conversation

@leenalmeadadi

@leenalmeadadi leenalmeadadi commented Sep 5, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #78

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The run function in packages/core/src/ripgrep.ts had high complexity. So I moved the exit code handling into a separate helper to make the function simpler. I also added a test for invalid regex patterns.

How did you verify your code works?

I ran the ripgrep tests and they passed. I also ran lint and checked the coverage for ripgrep.ts, which was 99.11%.

Screenshots / recordings

Screenshot 2026-09-06 at 2 32 50 AM Screenshot 2026-09-06 at 2 25 29 AM Screenshot 2026-09-06 at 2 31 24 AM Screenshot 2026-09-06 at 2 50 23 AM Screenshot 2026-09-06 at 2 52 40 AM Screenshot 2026-09-06 at 2 55 49 AM

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.
[

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.

P1B: Refactor (packages/core/src/ripgrep.ts:98): Function with high complexity (count = 19): run

1 participant