mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
20 lines
560 B
C#
20 lines
560 B
C#
using System;
|
|
|
|
namespace Semmle.Util
|
|
{
|
|
public class EnvironmentVariables
|
|
{
|
|
public static string? GetExtractorOption(string name) =>
|
|
Environment.GetEnvironmentVariable($"CODEQL_EXTRACTOR_CSHARP_OPTION_{name.ToUpper()}");
|
|
|
|
public static int GetDefaultNumberOfThreads()
|
|
{
|
|
if (!int.TryParse(Environment.GetEnvironmentVariable("CODEQL_THREADS"), out var threads) || threads == -1)
|
|
{
|
|
threads = Environment.ProcessorCount;
|
|
}
|
|
return threads;
|
|
}
|
|
}
|
|
}
|