forcedotcom / sfdx-scanner

MIT License
214 stars 49 forks source link

[BUG] InternalExecutionError has been thrown when running sf scanner run dfa #1593

Closed Jellybean0708 closed 1 month ago

Jellybean0708 commented 1 month ago

Have you tried to resolve this issue yourself first?

Yes

Bug Description

An InternalExecutionError error has been thrown during run sf scanner dfa. Here is code. image

Output / Logs

"10","3","D:\PMS e-cloudsoft\ec-print-gitee\eDocument DX-master\force-app\main\default\classes\ECP_TemplateDesignerCompCtrl.cls","215","39","ECP_TemplateDesignerCompCtrl","saveTemplateData","","","","InternalExecutionError","Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: UnexpectedException: ArrayLoadExpression{properties={FirstChild=false, BeginLine=935, DefiningType_CaseSafe=ecp_datasourcemapper, LastChild=true, DefiningType=ECP_DataSourceMapper, EndLine=935, childIdx=1, BeginColumn=29}}: com.salesforce.graph.symbols.PathScopeVisitor.afterVisit(PathScopeVisitor.java:761);com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterVisit(DefaultSymbolProviderVertexVisitor.java:737);com.salesforce.graph.vertex.ArrayLoadExpressionVertex.afterVisit(ArrayLoadExpressionVertex.java:58);com.salesforce.graph.ops.expander.ApexPathExpander.performAfterVisit(ApexPathExpander.java:577);com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:536);com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523)","https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/apexflsviolation-rule.html","InternalExecutionError","sfge"

Steps To Reproduce

Run the below command with sf scanner extension: sfdx scanner run dfa --format csv --outfile CodeAnalyzerDFA.csv --target="./" --projectdir="./" --category="Security" --sfgejvmargs "-Xmx10g" --pathexplimit -1 --rule-thread-count 2 --rule-thread-timeout 3600000

Expected Behavior

The result should show the code issue instead of the Internal Execution error.

Operating System

Windows 11

Salesforce CLI Version

@salesforce\cli\2.42.6 win32-x64 node-v20.12.2

Code Analyzer Plugin (@salesforce/sfdx-scanner) Version

@salesforce/sfdx-scanner: 4.3.2

Java Version

java version "17.0.9" 2023-10-17 LTS

Additional Context (Screenshots, Files, etc)

No response

Workaround

No response

Urgency

Low

stephen-carter-at-sf commented 1 month ago

Duplicate of 1497.