File lines of code value is less than function lines of code value from same file (JavaScript/JSX)

I’m using Sonarqube 7.6, and when scanning a JSX file, the render function has more lines of code than the file itself. Does anyone know why this is happening? Does SQ skip import statements and whitespace when calculating file size but does something different when calculating function loc?


Your version is well past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

7.6 → 7.9.6 → 8.9.10 → 9.8 (last step optional)

(Note that the release of a new LTS, 9.9, is expected on 7 Feb 2023.)

You may find the Upgrade Guide and the LTS-to-LTS Upgrade Notes helpful. If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.