An integer overflow might occur when the input or resulting value is too large to store in an associated representation. This can result in a critical security issue when it is used to make security decisions.
1function integerOverflowNoncompliant() {
2 // Noncompliant: bigint is assigned to a variable.
3 var max: number = 154327115334273650000012748329;
4}
1function integerOverflowCompliant() {
2 // Compliant: number is passed in BigInt() method is appended to an integer which makes it a bigint.
3 var max: BigInt = BigInt(154327115334273650000012748329);
4}