Parse Error while running Sonar Scan in ADO pipeline

Hello,

When ADO pipeline runs SonarQube scan for salesforce APEX code, it displays several parse errors as below. Is this due to SQ unable to parse .flow files?

##[error]ERROR: Unable to parse file: file:///D:/a/1/s/flows/Create_Contact_Sharing_for_new_Portal_Users_Flow.flow
ERROR: Parse error at line 268 column 3:

263: scheduledPaths 264: triggerType>RecordAfterSave triggerType 265: start
266: statusActivestatus 267: Flow

Has anyone got same parse error message for *.flow files?

Thanks!

Hi,

Welcome to the community!

I’m not familiar with .flow files. Can you explain what they are? Also, what version of SonarQube are you on? You can check the page footer if you’re not sure.

 
Ann

Hi Ann,

Salesforce uses APEX programming and .flow files are created for process flows inside SF.
Version of SQ used is: 8.9.6

I wanted to know from SQ community or experts whether parsing error may be due to SonarQube not able to understand .flow format file. Is there some documentation that lists out what file format can be scanned by SQ/version.

Thanks!

Hi,

I’ll be honest: I checked the docs before my initial response to you & it’s not clear what formats are supported. That’s why I asked what kind of file this is. :smiley:

.flow is not included in the list of default file extensions for the language, but I hoped this was merely a question of two names for the same thing.

FYI

But I guess not. I’m going to flag this for the language experts.

 
Ann

Hey @nareshk,

Thanks for bringing this up. As @ganncamp mentioned, .flow files are not picked up by the Apex analyzer by default.
But it might be that some other analyzer picks up the file during analysis.
Would you mind sharing:

  1. A copy of your analysis log (privately if needed)
  2. The Apex language version you are using

Cheers,

Dorian

Hi Dorian,

The details of error that was posted earlier was from the logs itself (first post). I am not seeing APEX version on SQ site. Do you know where to check that.

Now, I have implemented exclusions in ADO pipeline and it does not show *.flow file error. This fixes this *.flow issue.

However, I do see some other parsing errors, for ex below.

##[error]ERROR: Unable to parse file: file:///D:/a/1/s/classes/dupcheck__dc3ControllerAnalytics.cls. Parse error at position 1:0
##[error]ERROR: Cannot parse ‘classes/dupcheck__dc3ControllerAnalytics.cls’: ParseException: Syntax(error = UnexpectedToken(loc = (1, 1, 0, 1), token = ‘(’))

##[error]ERROR: Unable to parse file: file:///D:/a/1/s/classes/xx_WithFolders.cls. Parse error at position 1:0

##[error]ERROR: Cannot parse ‘classes/xx_Folders.cls’: ParseException: Syntax(error = UnexpectedToken(loc = (1, 1, 0, 1), token = ‘(’))

##[error]ERROR: Unable to parse file: file:///D:/a/1/s/classes/et4ae5__Test_etSwitchboard.cls. Parse error at position

Have you or anyone seen these parsing errors and any resolution.

Thanks!