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

New Rule S2445: Blocks should be synchronized on read-only fields #6701

Closed
zsolt-kolbay-sonarsource opened this issue Feb 2, 2023 · 2 comments · Fixed by #6750
Closed

New Rule S2445: Blocks should be synchronized on read-only fields #6701

zsolt-kolbay-sonarsource opened this issue Feb 2, 2023 · 2 comments · Fixed by #6750
Assignees
Labels
Area: C# C# rules related issues. Type: New Feature This hasn't been here before.
Projects
Milestone

Comments

@zsolt-kolbay-sonarsource
Copy link
Contributor

zsolt-kolbay-sonarsource commented Feb 2, 2023

Implement S2445 for C#

The check for private has been removed, following the outcome of the discussion here, summarized here.

@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource added Type: New Feature This hasn't been here before. Area: C# C# rules related issues. labels Feb 2, 2023
@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource added this to the 8.53 milestone Feb 8, 2023
@github-actions github-actions bot added this to To do in Best Kanban Feb 8, 2023
@pavel-mikula-sonarsource
Copy link
Contributor

We need to rename the rule to C# syntax

@antonioaversa antonioaversa moved this from To do to In progress in Best Kanban Feb 8, 2023
@antonioaversa antonioaversa changed the title New Rule S2445: Blocks should be synchronized on "private final" fields New Rule S2445: Blocks should be synchronized on "private readonly" fields Feb 13, 2023
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Feb 15, 2023
@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Feb 16, 2023
@antonioaversa antonioaversa modified the milestones: 8.53, 8.54 Feb 16, 2023
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Feb 22, 2023
@github-actions github-actions bot moved this from Review in progress to Review approved in Best Kanban Feb 22, 2023
@github-actions github-actions bot moved this from Review approved to Review in progress in Best Kanban Feb 22, 2023
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Feb 24, 2023
@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Feb 24, 2023
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Feb 27, 2023
@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Feb 27, 2023
@antonioaversa antonioaversa changed the title New Rule S2445: Blocks should be synchronized on "private readonly" fields New Rule S2445: Blocks should be synchronized on read-only fields Feb 27, 2023
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Feb 28, 2023
@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Feb 28, 2023
@github-actions github-actions bot moved this from In progress to Review approved in Best Kanban Feb 28, 2023
Best Kanban automation moved this from Review approved to Validate Peach Mar 1, 2023
@antonioaversa
Copy link
Contributor

antonioaversa commented Mar 3, 2023

Results of Peach Validation: many FP found on "locking of local variables" for "advanced" synchronization scenarios such as:

  • fine graned synchronization via collections of lock objects;
  • renaming of a readonly field in the context of the current method;
  • locking inside a loop, on the iteration variable.

A new rule S6507 has been created (#6854), to extract the offending check from S2445.
S6507 is still a BUG, but it is not in the Sonar Way.

@antonioaversa antonioaversa moved this from Validate Peach to Done in Best Kanban Mar 6, 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. Type: New Feature This hasn't been here before.
Projects
Best Kanban
  
Done
Development

Successfully merging a pull request may close this issue.

5 participants