Skip to content

Fixes to high level issues reported by Sonarcloud#228

Merged
nikomakela merged 9 commits into
mainfrom
HCRC-162-sonar-fixes
Dec 11, 2025
Merged

Fixes to high level issues reported by Sonarcloud#228
nikomakela merged 9 commits into
mainfrom
HCRC-162-sonar-fixes

Conversation

@nikomakela

Copy link
Copy Markdown
Contributor

HCRC-162.

HCRC-162.

Fixes "Expected the Promise rejection reason to be an Error."
HCRC-162.

Fixes 'Correct one of the identical sub-expressions on both sides of
operator "&&"'.
HCRC-162.

Fixes "Make sure the regex used here, which is vulnerable to
super-linear runtime due to backtracking, cannot lead to denial of
service." in `getTextFromHtml`.

Also added JSdocs and cleaned up the whole module.
HCRC-162.

The fixed security hotspots were safe, because they were only in
storybook demo files, but using Math.random() could still be replaced
with an array index, since only the siblings needs to have unique keys
in React (https://legacy.reactjs.org/docs/lists-and-keys.html
#keys-must-only-be-unique-among-siblings).

Also, for a random number in storybook, it's ok.
HCRC-162.

Sonarcloud reported "Refactor this function to reduce its Cognitive
Complexity from 29 to the 15 allowed. Cognitive Complexity of functions
should not be too high typescript:S3776".

Splitted the code of Card component to make it easier to read, maintain
and understand.
@sonarqubecloud

Copy link
Copy Markdown

node && node.toggleAttribute('inert', itemSetIndex !== currentSlide)
}
aria-hidden={itemSetIndex !== currentSlide}
key={getItemSetKey(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it safe to remove this key from the <li> tags here?

@nikomakela nikomakela Dec 11, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@nikomakela nikomakela merged commit 7f159a0 into main Dec 11, 2025
5 checks passed
@nikomakela nikomakela deleted the HCRC-162-sonar-fixes branch December 11, 2025 14:29
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