Version: SonarQube Version 10.1 (build 73491)
This is not strictly a false positive, but rather a case of conflicting / redundant rules / presentation for code like this:
public static IReadOnlyCollection<SomeType> = SomeStaticCollectionField;
This single line for a single reason triggers three separate rules:
- csharpsquid:2223 (Non-constant static fields should not be visible)
- csharpsquid:1104 (Fields should not have public accessibility)
- roslyn:CA2221 (non-Sonar) (Non-constant fields should not be visible)
See this screenshot for more context:
As the root cause is only one, I think only one code smell should be detected here.