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 S2094 FP: Should not raise for messages #9063

Closed
denis-troller opened this issue Apr 10, 2024 · 3 comments · Fixed by #9072
Closed

Fix S2094 FP: Should not raise for messages #9063

denis-troller opened this issue Apr 10, 2024 · 3 comments · Fixed by #9072
Assignees
Labels
Area: C# C# rules related issues. Area: VB.NET VB.NET rules related issues. Sprint: Hardening Fix FPs/FNs/improvements Type: False Positive Rule IS triggered when it shouldn't be.
Milestone

Comments

@denis-troller
Copy link

Description

It is not an uncommon pattern to have messages (commands, events) with absolutely no members in it when using messaging of any kind (Fluxor, MassTransit, Wolverine...) and especially in distributed environment.
In such cases, rule S2094 raises.

Repro steps

Consider the following classes, which are totally valid messages and events.

public class PlayCommand {}

public class StreamingServiceStartedEvent {}

Expected behavior

I would expect rule S2094 not to raise on such classes.

I would suggest ignoring classes that have known suffixes such as

  • Command
  • Event
  • Message
@denis-troller denis-troller added Type: False Positive Rule IS triggered when it shouldn't be. Area: C# C# rules related issues. Sprint: Hardening Fix FPs/FNs/improvements labels Apr 10, 2024
@Tim-Pohlmann Tim-Pohlmann added the Area: VB.NET VB.NET rules related issues. label Apr 11, 2024
@Tim-Pohlmann Tim-Pohlmann self-assigned this Apr 11, 2024
@Tim-Pohlmann
Copy link
Contributor

RSPEC PR

@fraserkyle
Copy link

Can you add Query suffix to this in order to cover CQRS design pattern please.

@CristianAmbrosini
Copy link
Contributor

Hi @fraserkyle! Can I ask you to open a new issue with your request? My colleagues will take care of it as soon as possible

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 Positive Rule IS triggered when it shouldn't be.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants