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 S1144 FN: Unused private getters and private setters #6724

Closed
zsolt-kolbay-sonarsource opened this issue Feb 6, 2023 · 0 comments · Fixed by #9098
Closed

Fix S1144 FN: Unused private getters and private setters #6724

zsolt-kolbay-sonarsource opened this issue Feb 6, 2023 · 0 comments · Fixed by #9098
Assignees
Labels
Area: C# C# rules related issues. Area: VB.NET VB.NET rules related issues. Sprint: Hardening Fix FPs/FNs/improvements Type: False Negative Rule is NOT triggered when it should be.
Projects
Milestone

Comments

@zsolt-kolbay-sonarsource
Copy link
Contributor

Description

S1144 does not highlight unused private getters or setters when they are inside a public property.

Repro steps

public class PropertyAccess
{
    public int PrivateGetter { private get; set; } // FN - unused private getter
    public int PrivateSetter { get; private set; } // FN - unused private setter

    public int ExpressionBodiedPropertyWithPrivateGetter { private get => 1; set => _ = value; } // FN - unused private getter
    public int ExpressionBodiedPropertyWithPrivateSetter { get => 1; private set => _ = value; } // FN - unused private setter
}

Expected behavior

An issue should be raised for the unused getter or setter.

Actual behavior

No issue is raised.

Known workarounds

None.

Related information

  • C#/VB.NET Plugins version: 8.52
  • Visual Studio version: 2022 17.4.4
  • Operating System: Windows 10 Pro (10.0.19045)
@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource added Type: False Negative Rule is NOT triggered when it should be. Area: C# C# rules related issues. labels Feb 6, 2023
@Tim-Pohlmann Tim-Pohlmann added this to the 9.24 milestone Apr 8, 2024
@Tim-Pohlmann Tim-Pohlmann added the Sprint: Hardening Fix FPs/FNs/improvements label Apr 8, 2024
@Tim-Pohlmann Tim-Pohlmann added this to To do in Best Kanban Apr 8, 2024
@cristian-ambrosini-sonarsource cristian-ambrosini-sonarsource moved this from To do to In progress in Best Kanban Apr 11, 2024
@Tim-Pohlmann Tim-Pohlmann added the Area: VB.NET VB.NET rules related issues. label Apr 17, 2024
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Apr 18, 2024
@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Apr 18, 2024
@github-actions github-actions bot moved this from In progress to Review in progress in Best Kanban Apr 18, 2024
@github-actions github-actions bot moved this from Review in progress to Review approved in Best Kanban Apr 18, 2024
Best Kanban automation moved this from Review approved to Validate Peach Apr 18, 2024
@CristianAmbrosini CristianAmbrosini moved this from Validate Peach to Done in Best Kanban Apr 19, 2024
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: VB.NET VB.NET rules related issues. Sprint: Hardening Fix FPs/FNs/improvements 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.

4 participants