Jquery-1.8.3 hit Loops should not be infinite rule

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();

				}

			}

		},


Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTA (long-term active version) at your earliest convenience. Your upgrade path is:

9.3 → 9.9.4 → 10.4 (last step optional)

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

If the issue persists after upgrade, please come back to us.

thanks. :grinning: