ERROR: Unable to parse file: file Parse error at position 1:0

Must-share information (formatted with Markdown):

  • which versions are you using ( sonar-scanner-4.1.0.1829)
  • what are you trying to achieve (parse apex code)
  • what have you tried so far to achieve this (not tried to change the code but want to know why this error is coming for most of our apex classes in org)

Hey there.

What SonarQube version are you using (you should be able to find this information in the footer of your instance).

And, if your code can’t be parsed, it would be great if you shared the code that fails to be parsed.

Hi ,

I am using ( sonar-scanner-4.1.0.1829) and sonarqube version is - * Enterprise Edition

  • Version 9.2.4 (build 50792)
  • LGPL v3

snippet of code that got failed to parsed is as below :

(hidden)

I think this error is expected right ?

I’m not sure you shared the code you think you shared – or is (hidden) really the content of the file?