Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] InternalExecutionError even /* sfge-disable-stack */ were assigned #1387

Closed
programmer522 opened this issue Mar 11, 2024 · 3 comments
Closed
Labels
duplicate This issue or pull request already exists SFGE Issues related to the Salesforce Graph Engine

Comments

@programmer522
Copy link

Fill out this template to submit your Code Analyzer issue.

Description:
Methods check was disabled via /* sfge-disable-stack */.
But InternalExecutionError error were thrown.

**Steps To Reproduce:
**Run the first scan.
sfdx scanner:run --format=csv --outfile=CodeAnalyzerGeneral.csv --target="./" --category="Security"

Run the second scan.
sfdx scanner:run:dfa --format=csv --outfile=CodeAnalyzerDFA.csv --target="./" --projectdir="./" --category="Security"

Expected Behavior:
After running the second scan csv file should be empty or with any errors described in documentation

Screenshots:
None

Desktop:

@jag-j
Copy link
Collaborator

jag-j commented Mar 13, 2024

@programmer522 - Can you please give us the whole exception (along with your code snippets where this exception was thrown)? Thank you!

@programmer522
Copy link
Author

programmer522 commented Mar 14, 2024

Exception: 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: NumberFormatException: For input string: "": java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67);java.base/java.lang.Integer.parseInt(Integer.java:678);java.base/java.lang.Integer.valueOf(Integer.java:999);com.salesforce.graph.symbols.apex.ApexSimpleValueFactory.valueOf(ApexSimpleValueFactory.java:93);com.salesforce.graph.symbols.apex.ApexSimpleValueFactory.lambda$static$0(ApexSimpleValueFactory.java:22);com.salesforce.graph.ops.ApexStandardLibraryUtil.getStandardType(ApexStandardLibraryUtil.java:155)

Code:@AuraEnabled
/* sfge-disable-stack */
public static void updatesubmission(String[] conIDs,ID jobId)
{
String timeInter='';
list<TimeIntervalbtwTwoEmails__mdt> tirec=[select MasterLabel,DeveloperName from TimeIntervalbtwTwoEmails__mdt where Active__c = TRUE WITH SECURITY_ENFORCED];
if(!tirec.isEmpty())
{
for(TimeIntervalbtwTwoEmails__mdt tit:tirec)
{
timeInter=tit.MasterLabel;
}
}
if(tirec.isEmpty())
{
timeInter='1';
}
list<Submission__c> subrecNotif=[select Id,ApplicantNameByAccount__c,ApplicantNameByContact__c,ApplicantObject__c,JobAlertNotifiedDate__c,JobAlertSent__c from Submission__c where (ApplicantNameByAccount__c IN :conIDs OR ApplicantNameByContact__c In :conIDs) AND JobCode__c =:jobId WITH SECURITY_ENFORCED];
for(Submission__c subfor:subrecNotif)
{
if(subfor.JobAlertNotifiedDate__c == null && subfor.JobAlertSent__c == null)
{
subfor.JobAlertNotifiedDate__c=System.today();
subfor.JobAlertSent__c = 1;
}
else if(subfor.JobAlertNotifiedDate__c <= Date.today().addDays(-Integer.valueOf(timeInter)))
{
subfor.JobAlertNotifiedDate__c=System.today();
subfor.JobAlertSent__c = subfor.JobAlertSent__c + 1;

}
else if(subfor.JobAlertNotifiedDate__c ==System.today())
{
}
}
SObjectAccessDecision securityDecision = Security.stripInaccessible( AccessType.UPDATABLE, subrecNotif);
update securityDecision.getRecords();
}


@stephen-carter-at-sf stephen-carter-at-sf added the SFGE Issues related to the Salesforce Graph Engine label May 23, 2024
@stephen-carter-at-sf stephen-carter-at-sf added the duplicate This issue or pull request already exists label Jun 3, 2024
@stephen-carter-at-sf
Copy link
Collaborator

Marking this as a duplicate of #1497

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists SFGE Issues related to the Salesforce Graph Engine
Projects
None yet
Development

No branches or pull requests

3 participants