Description
Have you tried to resolve this issue yourself first?
- I confirm I have gone through the above steps and still have an issue to report.
Bug Description
sf code-analyzer CLI is not flagging any lines that are missing AccessLevel
USER_MODE
when the SOQL is used to initialize a new Map
variable in Apex class.
Output / Logs
No response
Steps To Reproduce
-
Create an Apex class that have code like this:
Map<ID, Account> mapOfAccounts; mapOfAccounts = new Map<ID, Account>([select id,name from account where id in:setOfAccountId]);
-
Run following command on a Class:
sf code-analyzer run --rule-selector Recommended:Security --rule-selector AppExchange --output-file code-analyzer-results.json --output-file code-analyzer-report.html --output-file code-analyzer-report.csv
Expected Behavior
The SOQL should have been flagged with missing Access Level check.
Operating System
Windows 11 x64
Salesforce CLI Version
@salesforce/cli/2.90.4
Code Analyzer Plugin (code-analyzer) Version
code-analyzer 5.1.0
Node Version
node-v22.15.0
Java Version
java version "21.0.5" 2024-10-15 LTS
Python Version
Python 3.12.0
Additional Context (Screenshots, Files, etc)
No response
Workaround
No response
Urgency
Low