Describe the bug
Error running the command: sfdx scanner:run:dfa --target="./IFMAccountsContactManager.cls" --projectdir="./" --category="Security"
Error and stacktrace:
UnexpectedException: Query should have fields: Id NOT IN (INNER_QUERY) AND Phone LIKE : contactPhone:
com.salesforce.graph.ops.SoqlParserUtil.extractFields(SoqlParserUtil.java:333);
com.salesforce.graph.ops.SoqlParserUtil.parseFields(SoqlParserUtil.java:356);
com.salesforce.graph.ops.SoqlParserUtil.getSoqlQueryInfo(SoqlParserUtil.java:211);
com.salesforce.graph.ops.SoqlParserUtil.getInnerQueries(SoqlParserUtil.java:194);
com.salesforce.graph.ops.SoqlParserUtil.getInnerQueries(SoqlParserUtil.java:185);
com.salesforce.graph.ops.SoqlParserUtil.parseQuery(SoqlParserUtil.java:144)
To Reproduce
The following function is causing the error:
private static Integer getNumOfAccountElements(String contactPhone) {
Integer accs;
accs = [SELECT COUNT() FROM Account WHERE (Id NOT IN (SELECT AccountId FROM Contact) AND Phone LIKE : contactPhone) WITH USER_MODE ];
return accs;
}
Desktop (please complete the following information):
Describe the bug Error running the command: sfdx scanner:run:dfa --target="./IFMAccountsContactManager.cls" --projectdir="./" --category="Security" Error and stacktrace: UnexpectedException: Query should have fields: Id NOT IN (INNER_QUERY) AND Phone LIKE : contactPhone: com.salesforce.graph.ops.SoqlParserUtil.extractFields(SoqlParserUtil.java:333); com.salesforce.graph.ops.SoqlParserUtil.parseFields(SoqlParserUtil.java:356); com.salesforce.graph.ops.SoqlParserUtil.getSoqlQueryInfo(SoqlParserUtil.java:211); com.salesforce.graph.ops.SoqlParserUtil.getInnerQueries(SoqlParserUtil.java:194); com.salesforce.graph.ops.SoqlParserUtil.getInnerQueries(SoqlParserUtil.java:185); com.salesforce.graph.ops.SoqlParserUtil.parseQuery(SoqlParserUtil.java:144)
To Reproduce The following function is causing the error: private static Integer getNumOfAccountElements(String contactPhone) { Integer accs; accs = [SELECT COUNT() FROM Account WHERE (Id NOT IN (SELECT AccountId FROM Contact) AND Phone LIKE : contactPhone) WITH USER_MODE ]; return accs; }
Desktop (please complete the following information):
Additional context "Urgency": "Not business-stopping".