public static void Analyze(SyntaxNodeAnalysisContext context, ConstructorDeclarationSyntax constructor) { if (constructor.ParameterList?.Parameters.Any() == false && constructor.Body?.Statements.Any() == false) { SyntaxTokenList modifiers = constructor.Modifiers; if (modifiers.Contains(SyntaxKind.PublicKeyword) && !modifiers.Contains(SyntaxKind.StaticKeyword)) { ConstructorInitializerSyntax initializer = constructor.Initializer; if (initializer == null || initializer.ArgumentList?.Arguments.Any() == false) { if (IsSingleInstanceConstructor(constructor) && constructor .DescendantTrivia(constructor.Span) .All(f => f.IsWhitespaceOrEndOfLineTrivia())) { context.ReportDiagnostic(DiagnosticDescriptors.RemoveRedundantConstructor, constructor); } } } } }