File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
packages/react-native/src/lib Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -183,8 +183,8 @@ export const getLanguageCode = (
183183export const shouldDisplayBasedOnPercentage = (
184184 displayPercentage : number
185185) : boolean => {
186- const randomNum = Math . floor ( Math . random ( ) * 10000 ) / 100 ; // NOSONAR
187- return randomNum <= displayPercentage ;
186+ // NOSONAR: Math.random() is sufficient for non-security survey display logic
187+ return Math . random ( ) * 100 < displayPercentage ;
188188} ;
189189
190190export const isNowExpired = ( expirationDate : Date ) : boolean => {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export class SurveyStore {
2020 const prevSurvey = this . survey ;
2121 if ( prevSurvey ?. id !== survey . id ) {
2222 this . survey = survey ;
23- for ( const listener of this . listeners ) {
23+ for ( const listener of [ ... this . listeners ] ) {
2424 listener ( this . survey , prevSurvey ) ;
2525 }
2626 }
@@ -30,7 +30,7 @@ export class SurveyStore {
3030 const prevSurvey = this . survey ;
3131 if ( prevSurvey !== null ) {
3232 this . survey = null ;
33- for ( const listener of this . listeners ) {
33+ for ( const listener of [ ... this . listeners ] ) {
3434 listener ( this . survey , prevSurvey ) ;
3535 }
3636 }
You can’t perform that action at this time.
0 commit comments