Recently I ran a checkmarx scan and saw this issue
Query: Bulkify Apex Methods Using Collections In Methods
I don't understand why checkmarx is showing this issue in few places and not in all methods. Should I fix this, or can I add this in a false-positive report since I know I will be processing only one record per transaction? I would like to understand how checkmarx is evaluating for this issue. TIA.
Code Example:
public void test(Opportunity opp){
Account a = selectAccounts(new Set<Id>{opp.AccountId}).get(0);
}
public List<Account> selectAccounts(Set<Id> accountIds){
return [Select Id from Account where Id In : accountIds];
}