private static void RaiseWarningDiagnostic(SyntaxNodeAnalysisContext context, int parameterCount, string comparisonText, Location declarationLocation) { if (parameterCount == MaximumNumberOfParametersWarning) { comparisonText = "equal to"; } var warningMessage = $"Constructor has a total of {parameterCount} Parameters which is {comparisonText} the recommended maximum of {MaximumNumberOfParametersWarning}. Please consider refactoring the constructor / class."; DiagnosticsManager.ConstructorParameterDiagnostic(context, declarationLocation, WarningRule, warningMessage); }
private void RaiseErrorDiagnostic(SyntaxNodeAnalysisContext context, int parameterCount, string comparisonText, Location declarationLocation) { if (parameterCount == MaximumNumberOfParametersError) { comparisonText = "equal to"; } var warningMessage = $"Method has a total of {parameterCount} Parameters which is {comparisonText} the recommended maximum of {MaximumNumberOfParametersError}. Please refactor the method / class."; DiagnosticsManager.ConstructorParameterDiagnostic(context, declarationLocation, ErrorRule, warningMessage); }