Yeah this is exactly right, if you can trust the contributors to not code-golf or otherwise Goodhart the LoC metric, then it's a reasonable measure of complexity.
It doesn't work as well when you start mixing languages, or generating code.