Skip to content

Modify rule S3236: Add rule exception #4964

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

Merged
merged 5 commits into from
Apr 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rules/S3236/rule.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
== Why is this an issue?

Caller information attributes: ``++CallerFilePathAttribute++``, ``++CallerLineNumberAttribute++``, and ``++CallerArgumentExpressionAttribute++`` provide a way to get information about the caller of a method through optional parameters. But the arguments for these optional parameters are only generated if they are not explicitly defined in the call. Thus, specifying the argument values defeats the purpose of the attributes.
Caller information attributes: `CallerFilePathAttribute`, `CallerLineNumberAttribute`, and `CallerArgumentExpressionAttribute` provide a way to get information about the caller of a method through optional parameters. But the arguments for these optional parameters are only generated if they are not explicitly defined in the call. Thus, specifying the argument values defeats the purpose of the attributes.


=== Noncompliant code example
Expand Down Expand Up @@ -41,5 +41,5 @@ void MyMethod()

=== Exceptions

``++CallerMemberName++`` is not checked to avoid False-Positives with WPF/UWP applications.

* `CallerMemberName` is not checked to avoid False-Positives with WPF/UWP applications.
* `System.Diagnostics.Debug.Assert` is excluded as a custom message from the developer is sometimes preferred as an explanation of the failed assertion.