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

Fix S2589 FN: No BoolConstraint from numerical constant patterns #7780

Closed
mary-georgiou-sonarsource opened this issue Aug 11, 2023 · 0 comments · Fixed by #7846
Closed

Fix S2589 FN: No BoolConstraint from numerical constant patterns #7780

mary-georgiou-sonarsource opened this issue Aug 11, 2023 · 0 comments · Fixed by #7846
Assignees
Labels
Area: C# C# rules related issues. Area: CFG/SE CFG and SE related issues. Area: VB.NET VB.NET rules related issues. Sprint: SE Short-lived* label for epic MMF-3077 *troll Type: False Negative Rule is NOT triggered when it should be.
Projects
Milestone

Comments

@mary-georgiou-sonarsource
Copy link
Contributor

mary-georgiou-sonarsource commented Aug 11, 2023

Description

The SE engine does not learn a BoolConstraint from numerical constant patterns.

Repro steps

a = 0 switch
{
    1 => true            // FN
    , _ => false
};

Expected behavior

Should raise S2589 issue.

@mary-georgiou-sonarsource mary-georgiou-sonarsource added Type: False Negative Rule is NOT triggered when it should be. Area: CFG/SE CFG and SE related issues. Area: VB.NET VB.NET rules related issues. Area: C# C# rules related issues. labels Aug 11, 2023
@Tim-Pohlmann Tim-Pohlmann added the Sprint: SE Short-lived* label for epic MMF-3077 *troll label Aug 22, 2023
@Tim-Pohlmann Tim-Pohlmann added this to the 9.9 milestone Aug 22, 2023
@Tim-Pohlmann Tim-Pohlmann added this to To do in Best Kanban Aug 22, 2023
@Tim-Pohlmann Tim-Pohlmann moved this from To do to In progress in Best Kanban Aug 22, 2023
@Tim-Pohlmann Tim-Pohlmann self-assigned this Aug 22, 2023
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Aug 22, 2023
@Tim-Pohlmann Tim-Pohlmann moved this from Review in progress to In progress in Best Kanban Aug 22, 2023
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Aug 22, 2023
@Tim-Pohlmann Tim-Pohlmann changed the title Fix S2589 FN: Capture numerical constrain knowledge Fix S2589 FN: No BoolConstraints from numerical constant patterns Aug 23, 2023
@Tim-Pohlmann Tim-Pohlmann changed the title Fix S2589 FN: No BoolConstraints from numerical constant patterns Fix S2589 FN: No BoolConstraint from numerical constant patterns Aug 23, 2023
@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Aug 23, 2023
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Aug 23, 2023
@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Aug 24, 2023
@Tim-Pohlmann Tim-Pohlmann moved this from In progress to Review in progress in Best Kanban Aug 24, 2023
@mary-georgiou-sonarsource mary-georgiou-sonarsource moved this from Review in progress to In progress in Best Kanban Aug 28, 2023
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Aug 28, 2023
@github-actions github-actions bot moved this from Review in progress to Review approved in Best Kanban Aug 28, 2023
Best Kanban automation moved this from Review approved to Validate Peach Aug 28, 2023
@mary-georgiou-sonarsource mary-georgiou-sonarsource moved this from Validate Peach to Done in Best Kanban Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C# C# rules related issues. Area: CFG/SE CFG and SE related issues. Area: VB.NET VB.NET rules related issues. Sprint: SE Short-lived* label for epic MMF-3077 *troll Type: False Negative Rule is NOT triggered when it should be.
Projects
Best Kanban
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants