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

Default values/assignements 'MissingNullHandler' rule #38

Closed
TonyCrousty opened this issue Aug 3, 2023 · 5 comments
Closed

Default values/assignements 'MissingNullHandler' rule #38

TonyCrousty opened this issue Aug 3, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@TonyCrousty
Copy link

Hi, in the flow I scanned, it looks 3 cases of false positive matched :

Get_all_opport (recordLookups)

Indeed, there is no decision on 'null' value of the result, but a variable is assigned with a count on the collection. If the collection is null, then the count is '0'. And a decision manages this case.
Assignement extract :

    <assignments>
        <description>Nombre d&apos;offres créées. Si aucune offre trouvée (Get_all_opport = null), la variable est initialisée à 0.</description>
        <name>Nb_opport_found</name>
        <label>Nb opport found</label>
        <locationX>578</locationX>
        <locationY>1682</locationY>
        <assignmentItems>
            <assignToReference>nbExistingOpportFound</assignToReference>
            <operator>AssignCount</operator>
            <value>
                <elementReference>Get_all_opport</elementReference>
            </value>
        </assignmentItems>
        <connector>
            <targetReference>Offre</targetReference>
        </connector>
    </assignments>

Get_etab_from_Rubis (recordLookups)

is a recordLookup with a outputReference. This recordLookup is immediately followed with a 'null' check decision

Initial_lead_data (recordLookups)

same case than previous one. The only difference is the here, the 'null' check in the decision is part of several other conditions.

I can provide the full flow source if needed.

Regards,

@RubenHalman
Copy link
Contributor

RubenHalman commented Aug 3, 2023

Hi @TonyCrousty , thank you very much for making us aware of these. The first one is clear to me, but the other two I'm not so sure about. If it is possible to give me one of those full flows in a way you mask any confidential information that would be ideal. You can also mail them to me via halmandevlabs@gmail.com

@RubenHalman RubenHalman added the bug Something isn't working label Aug 3, 2023
@RubenHalman RubenHalman transferred this issue from Lightning-Flow-Scanner/lightning-flow-scanner-sfdx Aug 3, 2023
@TonyCrousty
Copy link
Author

Hi, just mailed you the complete flow source

@RubenHalman
Copy link
Contributor

@TonyCrousty We have resolved bugs in the MissingNullHandler rule in the latest version, v2.11. However, the first lookup 'Get_all_opport' is still coming up as a violation. We will definitely still aim to enhance the rule so to support these types of use cases where a default value is assigned, but for now I recommend you define it as an exception.

@RubenHalman RubenHalman added enhancement New feature or request and removed bug Something isn't working labels Aug 7, 2023
@RubenHalman RubenHalman changed the title False positive 'MissingNullHandler' rule Default values/assignements 'MissingNullHandler' rule Aug 7, 2023
@RubenHalman
Copy link
Contributor

@TonyCrousty do you know how to define the exception?

@RubenHalman
Copy link
Contributor

For now I am closing this issue. @TonyCrousty please do let us know if you find the current solution acceptable

@RubenHalman RubenHalman closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants