Make sure to read this post before raising a thread here:
Then tell us:
-
What language is this for?
javascript
jquery-1.8.3.js -
Which rule?
Loops should not be infinite -
Why do you believe it’s a false-positive/false-negative?
list is an arrary, firingIndex will change. -
Are you using
SonarQube - Version 9.3 (build 51899) -
How can we reproduce the problem? Give us a self-contained snippet of code (formatted text, no screenshots)
https://code.jquery.com/jquery-1.8.3.js
line: 973
fire = function( data ) {
memory = options.memory && data;
fired = true;
firingIndex = firingStart || 0;
firingStart = 0;
firingLength = list.length;
firing = true;
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
memory = false; // To prevent further calls using add
break;
}
}
firing = false;
if ( list ) {
if ( stack ) {
if ( stack.length ) {
fire( stack.shift() );
}
} else if ( memory ) {
list = [];
} else {
self.disable();
}
}
},