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 when running getsObjectTabIcons method #1341

Closed
RonanWilliams1 opened this issue Jan 31, 2024 · 2 comments
Closed
Labels
BUG P3 Rarely Malfunction duplicate This issue or pull request already exists SFGE Issues related to the Salesforce Graph Engine

Comments

@RonanWilliams1
Copy link

Description:
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: ApexStandardValue{apexType='System.Schema'} ApexValue(SystemSchema) {status=INITIALIZED, declarationVertex=null, valueVertex=null, resolvedValues={}, returnedFrom=null, invocableExpression=null, method=null}: com.salesforce.graph.symbols.apex.system.SystemSchema.executeMethod(SystemSchema.java:106);com.salesforce.graph.symbols.PathScopeVisitor.afterMethodCall(PathScopeVisitor.java:659);com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterMethodCall(DefaultSymbolProviderVertexVisitor.java:318);com.salesforce.graph.ops.expander.ApexPathExpander.handleMethodCall(ApexPathExpander.java:681);com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:532);com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:452)

Method code where the error occurs:

`
public static Map<String,String> getsObjectTabIcons() {

    Map<String,String> sObjectIcons = new Map<String,String>();
    
    // get sObject tab icons
    for(Schema.DescribeTabSetResult tsr : Schema.describeTabs()){
        for(Schema.DescribeTabResult tr : tsr.getTabs()) {
            for (Schema.DescribeIconResult ir : tr.getIcons()) {
                if (ir.getContentType() == 'image/svg+xml'){
                    String url = ir.getUrl().substringBeforeLast('.svg');
                    List<String> urlElements = url.split('/');
                    sObjectIcons.put(tr.getSobjectName(),urlElements[urlElements.size() - 2] + ':' + urlElements[urlElements.size() - 1]);
                }
            }
        }
    }

    // add non tab icons
    Map<String,String> nonTabIcons = new Map<String,String>{
        'Task' => 'standard:task'
    };

    for (String sObjectName : nonTabIcons.keySet()){
        if (!sObjectIcons.containsKey(sObjectName)){
            sObjectIcons.put(sObjectName, nonTabIcons.get(sObjectName));
        }
    }

    return sObjectIcons;
} `

Steps To Reproduce:
I ran the following scanner:
sf scanner run dfa -f html -o QA/appexchange/CodeAnalyzerDFA.html -t './' -c 'Security' --projectdir='./'

Desktop:
Provide these details:

Operating System: Mac OS
Code Analyzer version: v3.20.0
Salesforce CLI version: @salesforce/cli/2.23.20 win32-x64 node-v18.19.0
Additional Context:

Workaround:
Tried the directives to exclude from the engine, but it doesn't work
Urgency:
Medium

@johnbelosf johnbelosf added the BUG P3 Rarely Malfunction label Feb 20, 2024
Copy link

git2gus bot commented Feb 20, 2024

This issue has been linked to a new work item: W-15080648

@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
BUG P3 Rarely Malfunction 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