private Diagnostic HandleProperty(PropertyDeclarationSyntax propertyDeclaration) { if (propertyDeclaration.ExpressionBody != null) { return(null); } if (propertyDeclaration.DescendantNodesAndTokensAndSelf().Any(x => x.GetLeadingTrivia().Concat(x.GetTrailingTrivia()).Any(y => !y.IsWhitespaceTrivia()))) { return(null); } var getter = propertyDeclaration.AccessorList.Accessors.FirstOrDefault(x => x.Keyword.ValueText == "get"); if (getter == null) { return(null); } if (getter.AttributeLists.Any(x => x.Attributes.Any())) { return(null); } if (getter.Body?.Statements.Count != 1) { return(null); } var statement = getter.Body.Statements.First(); return(Diagnostic.Create(Rule, statement.GetLocation(), "Property", propertyDeclaration.Identifier)); }