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

Migrate S3966 to the new Symbolic Execution engine #7302

Closed
3 tasks done
pavel-mikula-sonarsource opened this issue May 30, 2023 · 1 comment · Fixed by #7338
Closed
3 tasks done

Migrate S3966 to the new Symbolic Execution engine #7302

pavel-mikula-sonarsource opened this issue May 30, 2023 · 1 comment · Fixed by #7338
Assignees
Labels
Area: C# C# rules related issues. Area: CFG/SE CFG and SE related issues.
Milestone

Comments

@pavel-mikula-sonarsource
Copy link
Contributor

pavel-mikula-sonarsource commented May 30, 2023

Migrate ObjectsShouldNotBeDisposedMoreThanOnce

Split the work in 3 PRs:

  • Scaffold the rule
    • Prepare empty rule with ShouldExecute false
    • Prepare tests and test cases - mark old Noncompliant as FIXME Non-compliant
    • Do not register in SymbolicExecutionRunner (yet)
  • Implement
    • Implement rule logic, switch ShouldExecute to true
    • Register in SymbolicExecutionRunner
    • Update ITs
  • Finish the rule
    • Implement ShouldExecute
    • Remove all FIXME from test cases, mark them as FNs or Compliant

Additional steps to improve the rule:
Implement different messages according to the issue raised. One message for double disposal through the user calling Dispose or Close twice and one for the using statement, where the Dispose is called in Finally hidden behind using.

@mary-georgiou-sonarsource
Copy link
Contributor

The last point is nice to have and will be implemented in follow-up PR (if time allows it - otherwise I'll remove it from here)

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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants