Skip to content

fix(sonarqube): typescript S6481 fix - #108

Merged
PVinaches merged 1 commit into
KaotoIO:1.xfrom
PVinaches:sonarqube-typescript-S6481-backport
Jul 27, 2026
Merged

fix(sonarqube): typescript S6481 fix#108
PVinaches merged 1 commit into
KaotoIO:1.xfrom
PVinaches:sonarqube-typescript-S6481-backport

Conversation

@PVinaches

@PVinaches PVinaches commented Jul 27, 2026

Copy link
Copy Markdown
Member

fix sonarqube issue typescript S6481 - “The value object passed as the value prop to the Context provider changes every render. To fix this consider wrapping it in a useMemo hook.”

Summary by CodeRabbit

  • Performance
    • Improved form filtering efficiency by stabilizing shared filtering state between renders.
    • Preserved existing filtering behavior, including text updates and automatic group expansion during searches.

@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7700d7dc-b393-49af-9171-97827d3f8eef

📥 Commits

Reviewing files that changed from the base of the PR and between f76fee1 and db4d3fc.

📒 Files selected for processing (1)
  • src/form/providers/filtered-field.provider.tsx

📝 Walkthrough

Walkthrough

The filtered field provider now memoizes its context value with useMemo, using searchTerm and onFilterChange as dependencies while preserving the existing context fields.

Changes

Filtered field context

Layer / File(s) Summary
Memoized provider context
src/form/providers/filtered-field.provider.tsx
Imports useMemo and passes a memoized context object containing filteredFieldText, onFilterChange, and isGroupExpanded to the provider.

Estimated code review effort: 2 (Simple) | ~5 minutes

Poem

I’m a bunny with a memo in sight,
Keeping context steady and light.
Search terms hop, callbacks stay,
Fewer fresh objects every day.
“Efficient!” I twitch my nose—
The filtered field now softly flows.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: a SonarQube TypeScript S6481 fix for the context provider value.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@PVinaches
PVinaches merged commit 773f8bb into KaotoIO:1.x Jul 27, 2026
7 checks passed
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