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 S4545: "DebuggerDisplayAttribute" strings should reference existing members #6703

Closed
zsolt-kolbay-sonarsource opened this issue Feb 2, 2023 · 0 comments · Fixed by #6728
Assignees
Labels
Area: C# C# rules related issues. Area: VB.NET VB.NET rules related issues.
Milestone

Comments

@zsolt-kolbay-sonarsource
Copy link
Contributor

zsolt-kolbay-sonarsource commented Feb 2, 2023

Implement S4545 for C# and VB.NET

RSPEC PR: SonarSource/rspec#1571

Remark: implementation merged before corresponding RSPEC is ready. Changes to the sonar-dotnet repo are to be expected, when running rspec update upon release.

Peach Validation

During validation on peach, the following positive cases about case sensitivity were found:

The check for existing members done by this implementation is done respecting case sensitivity rules for the language in which the source was written, although they should be done according to case sensitivity rules for the language in which the debugger is being executed.
Therefore, a DebuggerDisplayAttribute containing a format string with a reference to a property in wrong case would generate an exception in debugger when debugging a C# project, whereas it would not on a VB.NET project.

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