Skip to content

NET-3549 Fix S2583 FP: When setting it in a callback #9794

Open

Description

@bdovaz

Description

ButtonResult buttonResult = ButtonResult.Yes;

await dialogService.Show(dialogResult => buttonResult = dialogResult.Result);

// FP here: Change this condition so that it does not always evaluate to 'False'. Some code paths are unreachable.
if (buttonResult == ButtonResult.OK)
{
}

Reproducer

With the code above

Product and Version

SonarQube Cloud

Activity

  1. jilles-sg commented on Mar 7, 2026

    @jilles-sg

    Seems similar to #9676 #9671 #9425 #9204 #8885 : symbolic execution doesn't handle lambdas and local functions correctly.

  2. bdovaz commented on Mar 7, 2026

    @bdovaz
    Author

    Issues from 3 years ago... I am surprised that this problem still exists today.

  3. self-assigned this
    on Apr 2, 2026
  4. github-actions commented on Apr 2, 2026

    @github-actions
    Contributor

    Internal ticket NET-3549

  5. changed the title [-]Fix S2583 FP: When setting it in a callback[/-] [+]NET-3549 Fix S2583 FP: When setting it in a callback[/+] on Apr 2, 2026
  6. removed their assignment
    on Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    False PositiveRule IS triggered when it shouldn't be.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions