Skip to content

fix: replace indexOf existence checks with includes (SonarCloud maintainability)#138

Open
mnashawati wants to merge 3 commits into
developfrom
feature/FI0-11035-sonar-indexof-to-includes
Open

fix: replace indexOf existence checks with includes (SonarCloud maintainability)#138
mnashawati wants to merge 3 commits into
developfrom
feature/FI0-11035-sonar-indexof-to-includes

Conversation

@mnashawati
Copy link
Copy Markdown
Contributor

@mnashawati mnashawati commented Mar 31, 2026

Description

Please include a summary of the change:

  • Replace .indexOf() !== -1 / >= 0 / === -1 patterns with .includes() across 6 source files. This addresses ~9 SonarCloud code smell issues (es6 readability).

  • .includes() is functionally identical for existence checks and is more readable.

Fixes - Jira Link #
https://eaflood.atlassian.net/browse/FI0-11035

Type of change

Please tick the relevant option for your PR request. Follow Semantic Version: vMAJOR.MINOR.PATCH

  • Bug fix - PATCH (non-breaking change which fixes an issue)
  • New feature - MINOR (non-breaking change which adds functionality)
  • Breaking change - MAJOR (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update, or other non-code files.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@mnashawati mnashawati force-pushed the feature/FI0-11035-sonar-indexof-to-includes branch from 3a3753a to e0a4b82 Compare March 31, 2026 10:04
@mnashawati mnashawati force-pushed the feature/FI0-11035-sonar-indexof-to-includes branch from e0a4b82 to 9278e2b Compare March 31, 2026 10:17
@sonarqubecloud
Copy link
Copy Markdown

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