Fixes to high level issues reported by Sonarcloud#228
Merged
Conversation
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.
HCRC-162
|
| node && node.toggleAttribute('inert', itemSetIndex !== currentSlide) | ||
| } | ||
| aria-hidden={itemSetIndex !== currentSlide} | ||
| key={getItemSetKey( |
Contributor
There was a problem hiding this comment.
Is it safe to remove this key from the <li> tags here?
Contributor
Author
There was a problem hiding this comment.
karisal-anders
approved these changes
Dec 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




HCRC-162.