private static ParameterSettings GetParameterSettings([NotNull] AnalyzerOptions options, CancellationToken cancellationToken) { AnalyzerSettingsRegistry registry = AnalyzerSettingsProvider.LoadSettings(options, cancellationToken); int maxParameterCount = registry.TryGetInt32(MaxParameterCountKey, 0, 255) ?? DefaultMaxParameterCount; int maxConstructorParameterCount = registry.TryGetInt32(MaxConstructorParameterCountKey, 0, 255) ?? maxParameterCount; return(new ParameterSettings(maxParameterCount, maxConstructorParameterCount)); }
private static int GetMaxStatementCountFromSettings([NotNull] AnalyzerOptions options, CancellationToken cancellationToken) { AnalyzerSettingsRegistry registry = AnalyzerSettingsProvider.LoadSettings(options, cancellationToken); return(registry.TryGetInt32(MaxStatementCountKey, 0, 255) ?? DefaultMaxStatementCount); }
private static int GetMaxParameterCountFromSettings([NotNull] AnalyzerOptions options, CancellationToken cancellationToken) { AnalyzerSettingsRegistry registry = AnalyzerSettingsProvider.LoadSettings(options, cancellationToken); var settingKey = new AnalyzerSettingKey(DiagnosticId, "MaxParameterCount"); return(registry.TryGetInt32(settingKey, 0, 255) ?? DefaultMaxParameterCount); }