sleep
is sometimes used in a mistaken attempt to prevent Denial of Service (DoS) attacks by throttling response rate. But because it
ties up a thread, each request takes longer to serve that it otherwise would, making the application more vulnerable to DoS attacks, rather
than less.
Noncompliant Code Example
if (is_bad_ip($requester)) {
sleep(5); // Noncompliant
}
See
Deprecated
This rule is deprecated, and will eventually be removed.