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

S1186: FP: Conditional compilation in method should not be considered empty #5856

Closed
martin-strecker-sonarsource opened this issue Jul 15, 2022 · 0 comments · Fixed by #5855
Assignees
Labels
Area: C# C# rules related issues. Type: False Positive Rule IS triggered when it shouldn't be.
Milestone

Comments

@martin-strecker-sonarsource
Copy link
Contributor

Description

see https://community.sonarsource.com/t/csharpsquid-s1186-methods-should-not-be-empty-false-positive/67093

"S1186 Methods should not be empty" should not be raised here:

public void JobAdded(IJobDetail jobDetail) {
#if DEBUG
    _logManager.Log(LogType.Database | LogType.File, new LogMessage {
            MessageType = LogMessageType.Info,
            CustomData = { { "JobAdded", jobDetail.JobType.Name } },
            MessageCategory = this.GetTypeName()
    });
#endif
}
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: False Positive Rule IS triggered when it shouldn't be.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants