I feel like this Cryengine example may be a bad example of that, though.
It also makes no sense to have a rule on the maximum number of lines for a function. These rules are often created by people who don't write software that needs to have high performance.
How common is automated testing in AAA games?