Skip to content

Commit

Permalink
remove check for const as if there is static keyword then const will …
Browse files Browse the repository at this point in the history
…never be there
  • Loading branch information
mary-georgiou-sonarsource committed Feb 17, 2023
1 parent 9537be3 commit c906d02
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public sealed class StaticFieldVisible : SonarDiagnosticAnalyzer
private static bool FieldIsRelevant(FieldDeclarationSyntax node) =>
!node.Modifiers.Any(SyntaxKind.PrivateKeyword)
&& node.Modifiers.Any(SyntaxKind.StaticKeyword)
&& !(node.Modifiers.Any(SyntaxKind.ConstKeyword) || node.Modifiers.Any(SyntaxKind.ReadOnlyKeyword));
&& !node.Modifiers.Any(SyntaxKind.ReadOnlyKeyword);

private static bool FieldIsThreadSafe(IFieldSymbol fieldSymbol) =>
fieldSymbol.GetAttributes().Any(x => x.AttributeClass.Is(KnownType.System_ThreadStaticAttribute));
Expand Down

0 comments on commit c906d02

Please sign in to comment.