public static void AnalyzeVariable(SyntaxNodeAnalysisContext context, VariableDeclarationSyntax syntax) { if (syntax == null) { return; } IdentifierNameSyntax syntaxName = syntax.Name; SyntaxKind syntaxKind = syntax.Kind; string name = syntax.GetNameStringValue(); if (!IsVariableNamePascalCase(name)) { ReportVariableNameMustBeDeclaratedInPascalCase(context, syntaxName.GetLocation(), name, syntaxKind, syntaxName); } if (IsVaraibleContainWhiteSpace(name)) { ReportVariableNameMayNotContainWhiteSpace(context, syntaxName.GetLocation(), name, syntaxKind, syntaxName); } if (IsVaraibleContainWildcardSymbols(name)) { ReportVariableNameMayNotContainWildcardSymbols(context, syntaxName.GetLocation(), name, syntaxKind, syntaxName); } }