Skip to content

Commit fa7f437

Browse files
committed
Code quality improvement
1 parent 322fb6c commit fa7f437

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

csharp/extractor/Semmle.Extraction.CSharp/Entities/Compilations/CompilerDiagnostic.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Semmle.Extraction.CSharp.Entities
66
{
77
internal class CompilerDiagnostic : FreshEntity
88
{
9-
private static readonly int limit = EnvironmentVariables.TryGetExtractorOption<int>("COMPILER_DIAGNOSTIC_LIMIT") ?? 1000;
9+
private static readonly int limit = EnvironmentVariables.TryGetExtractorNumberOption<int>("COMPILER_DIAGNOSTIC_LIMIT") ?? 1000;
1010
private static readonly ConcurrentDictionary<string, int> messageCounts = new();
1111

1212
private readonly Microsoft.CodeAnalysis.Diagnostic diagnostic;

csharp/extractor/Semmle.Extraction/Entities/ExtractionMessage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Semmle.Extraction.Entities
66
{
77
internal class ExtractionMessage : FreshEntity
88
{
9-
private static readonly int limit = EnvironmentVariables.TryGetExtractorOption<int>("MESSAGE_LIMIT") ?? 10000;
9+
private static readonly int limit = EnvironmentVariables.TryGetExtractorNumberOption<int>("MESSAGE_LIMIT") ?? 10000;
1010
private static int messageCount = 0;
1111

1212
private readonly Message msg;

csharp/extractor/Semmle.Util/EnvironmentVariables.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class EnvironmentVariables
99
public static string? GetExtractorOption(string name) =>
1010
Environment.GetEnvironmentVariable($"CODEQL_EXTRACTOR_CSHARP_OPTION_{name.ToUpper()}");
1111

12-
public static T? TryGetExtractorOption<T>(string name) where T : struct, INumberBase<T>
12+
public static T? TryGetExtractorNumberOption<T>(string name) where T : struct, INumberBase<T>
1313
{
1414
var value = GetExtractorOption(name);
1515
if (T.TryParse(value, NumberStyles.Number, CultureInfo.InvariantCulture, out var result))

0 commit comments

Comments
 (0)