Sonarcloud feature request Apex Null Coalescing Operator

We are using SonarCloud, but are since the introduction of the Apex Null Coalescing Operator feature are facing errors everyday in our scans.

Errors:

ERROR: Unable to parse file: file:///home/vsts/work/1/s/force-app/main/default/classes/triggerActions/Name/NameTriggerHandler.cls. Parse error at position 1:0

Just analyzed the file in question and learned all the errors are files with the new feature Apex Null Coalescing Operator used.

So this topic is to request to add Apex Null Coalescing Operator to SonarCloud.

Some reference to the Apex Null Coalescing Operator https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_NullCoalescingOperator.htm

1 Like

Hello @Theodoor_van_Donge
Thanks for your post.
As said by email earlier today, our team acknowledged your Apex analysis issue.
They are currently investigating it and will get back to you with feedback once done :slight_smile:
David

1 Like

Hi Theodoor,

Thanks for your feedback! Since the Null Coalescing Operator is a new syntactical feature in Apex (?? token), we need to apply the latest Apex parser version (from the Spring’24 release) in order to support it.

I created a ticket for that here and it should be part of our next SLANG release. In the meantime, the only possible workaround is to exclude files using that feature from the analysis.

Best,
Marco

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.