Skip to main content

If you run Salesforce Code Analyzer without the --category option as shown below, you will get the following message and exit with an error.

 

sf scanner run --target './force-app/main/default/classes/'  --format csv > ./@scanner/classes.csv

Running Code Analyzer without the --category option causes an error (error messages are also garbled).The error message is garbled, so I cannot understand the details of the error and do not know how to respond.

 

If I run it with the --category 'Security' option, the error disappears, but only the information of the Security category of the pmd engine is displayed. (Of course...)

Am I missing some action to use the “retire-js” engine from the message?

 

sf scanner run --category 'Security' --target './force-app/main/default/classes/'  --format csv > ./@scanner/classes1.csv

CodeAnalyzerOK.pngCodeAnalyzerCSVOutput.png

2 respostas
  1. 30 de dez. de 2024, 14:25

    Note that this specific node issue with the retire-js engine will be fixed with our release that will be going out at the end of this week for both Code Analyzer v4 and Code Analyzer v5.

     

    But also, I'd like to note that soon (within the next few months) we may be ending support for Code Analyzer v4. So we recommend you start using Code Analyzer v5, that is the new code-analyzer cli plugin instead: 

    https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/code-analyzer.html

     

    With Code Analyzer v5, rule selection is far easier using our --rule-selector argument. You can even assign your own tags to categorize your rules as you wish inside of your code-analyzer.yml configuration file.

     

    To install v5:

    sf plugins install code-analyzer

    and then do

    sf code-analyzer rulessf code-analyzer runsf code-analyzer config

    to learn more!

0/9000