Language of the file cannot be decided - Apex

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension)

  • Data Center Edition

  • v2025.1.1 (104738)

  • how is SonarQube deployed: zip, Docker, Helm

  • what are you trying to achieve

  • what have you tried so far to achieve this

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Running into a new SonarQube error with Salesforce code:
ERROR Language of file ‘force-app/main/default/classes/xxxxxxx.cls’ can not be decided as the file matches patterns of both sonar.lang.patterns.apex : /*.cls,/.trigger and sonar.lang.patterns.sf : **/.cls,**/*.trigger
I cannot remove the sonar.lang.patterns.sf pattern from the CodeScan options and I cannot find “sonar.lang.patterns.apex” in the settings to remove.

Hi,

Welcome to the community!

This should be settable at both the global and project levels under Languages. Keep in mind though that this can also be set CI-side in your analysis properties or on the analysis command line,

 
HTH,
Ann

P.S. As a Data Center customer, you have access to our professional support engineers who have things like SLAs. :slight_smile:

1 Like