mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Merge branch 'main' into mathiasvp/read-step-without-memory-operands
This commit is contained in:
@@ -88,7 +88,7 @@ namespace Semmle.BuildAnalyser
|
||||
nuget = new NugetPackages(sourceDir.FullName, PackageDirectory);
|
||||
ReadNugetFiles();
|
||||
}
|
||||
catch(FileNotFoundException)
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
progressMonitor.MissingNuGet();
|
||||
}
|
||||
@@ -97,7 +97,9 @@ namespace Semmle.BuildAnalyser
|
||||
// Find DLLs in the .Net Framework
|
||||
if (options.ScanNetFrameworkDlls)
|
||||
{
|
||||
dllDirNames.Add(Runtime.Runtimes.First());
|
||||
var runtimeLocation = Runtime.GetRuntime(options.UseSelfContainedDotnet);
|
||||
progressMonitor.Log(Util.Logging.Severity.Debug, $"Runtime location selected: {runtimeLocation}");
|
||||
dllDirNames.Add(runtimeLocation);
|
||||
}
|
||||
|
||||
// These files can sometimes prevent `dotnet restore` from working correctly.
|
||||
@@ -279,7 +281,7 @@ namespace Semmle.BuildAnalyser
|
||||
|
||||
void AnalyseProject(FileInfo project)
|
||||
{
|
||||
if(!project.Exists)
|
||||
if (!project.Exists)
|
||||
{
|
||||
progressMonitor.MissingProject(project.FullName);
|
||||
return;
|
||||
@@ -323,7 +325,7 @@ namespace Semmle.BuildAnalyser
|
||||
void Restore(string projectOrSolution)
|
||||
{
|
||||
int exit = DotNet.RestoreToDirectory(projectOrSolution, PackageDirectory.DirInfo.FullName);
|
||||
switch(exit)
|
||||
switch (exit)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
@@ -342,7 +344,7 @@ namespace Semmle.BuildAnalyser
|
||||
|
||||
public void AnalyseSolutions(IEnumerable<string> solutions)
|
||||
{
|
||||
Parallel.ForEach(solutions, new ParallelOptions { MaxDegreeOfParallelism = 4 } , solutionFile =>
|
||||
Parallel.ForEach(solutions, new ParallelOptions { MaxDegreeOfParallelism = 4 }, solutionFile =>
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
{
|
||||
public override bool handleFlag(string key, bool value)
|
||||
{
|
||||
switch(key)
|
||||
switch (key)
|
||||
{
|
||||
case "silent":
|
||||
Verbosity = value ? Verbosity.Off : Verbosity.Info;
|
||||
@@ -36,6 +36,9 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
case "skip-dotnet":
|
||||
ScanNetFrameworkDlls = !value;
|
||||
return true;
|
||||
case "self-contained-dotnet":
|
||||
UseSelfContainedDotnet = value;
|
||||
return true;
|
||||
default:
|
||||
return base.handleFlag(key, value);
|
||||
}
|
||||
@@ -43,7 +46,7 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
|
||||
public override bool handleOption(string key, string value)
|
||||
{
|
||||
switch(key)
|
||||
switch (key)
|
||||
{
|
||||
case "exclude":
|
||||
Excludes.Add(value);
|
||||
@@ -134,6 +137,11 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
/// </summary>
|
||||
public bool Help = false;
|
||||
|
||||
/// <summary>
|
||||
/// Whether to use the packaged dotnet runtime.
|
||||
/// </summary>
|
||||
public bool UseSelfContainedDotnet = false;
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether the given path should be excluded.
|
||||
/// </summary>
|
||||
@@ -162,6 +170,7 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
output.WriteLine(" --threads:nnn Specify number of threads (default=CPU cores)");
|
||||
output.WriteLine(" --verbose Produce more output");
|
||||
output.WriteLine(" --pdb Cross-reference information from PDBs where available");
|
||||
output.WriteLine(" --self-contained-dotnet Use the .Net Framework packaged with the extractor");
|
||||
}
|
||||
|
||||
private Options()
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Semmle.BuildAnalyser
|
||||
void NugetInstall(string package);
|
||||
void ResolvedReference(string filename);
|
||||
void Summary(int existingSources, int usedSources, int missingSources, int references, int unresolvedReferences, int resolvedConflicts, int totalProjects, int failedProjects, TimeSpan analysisTime);
|
||||
void Warning(string message);
|
||||
void Log(Severity severity, string message);
|
||||
void ResolvedConflict(string asm1, string asm2);
|
||||
void MissingProject(string projectFile);
|
||||
void CommandFailed(string exe, string arguments, int exitCode);
|
||||
@@ -93,9 +93,9 @@ namespace Semmle.BuildAnalyser
|
||||
logger.Log(Severity.Info, "Build analysis completed in {0}", analysisTime);
|
||||
}
|
||||
|
||||
public void Warning(string message)
|
||||
public void Log(Severity severity, string message)
|
||||
{
|
||||
logger.Log(Severity.Warning, message);
|
||||
logger.Log(severity, message);
|
||||
}
|
||||
|
||||
public void ResolvedConflict(string asm1, string asm2)
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
/// <summary>
|
||||
/// Locates .NET Core Runtimes.
|
||||
/// </summary>
|
||||
public static IEnumerable<string> CoreRuntimes
|
||||
private static IEnumerable<string> CoreRuntimes
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -37,7 +37,7 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
/// Locates .NET Desktop Runtimes.
|
||||
/// This includes Mono and Microsoft.NET.
|
||||
/// </summary>
|
||||
public static IEnumerable<string> DesktopRuntimes
|
||||
private static IEnumerable<string> DesktopRuntimes
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -63,7 +63,12 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerable<string> Runtimes
|
||||
/// <summary>
|
||||
/// Gets the .NET runtime location to use for extraction
|
||||
/// </summary>
|
||||
public static string GetRuntime(bool useSelfContained) => useSelfContained ? ExecutingRuntime : Runtimes.First();
|
||||
|
||||
private static IEnumerable<string> Runtimes
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
@@ -332,11 +332,12 @@ final class DeclarationWithAccessorsNode extends ElementNode {
|
||||
result.(ElementNode).getElement() = declaration.(Property).getInitializer().getParent()
|
||||
or
|
||||
result.(ElementNode).getElement() =
|
||||
rank[childIndex - 2](Element a, string file, int line, int column |
|
||||
rank[childIndex - 2](Element a, string file, int line, int column, string name |
|
||||
a = declaration.getAnAccessor() and
|
||||
locationSortKeys(a, file, line, column)
|
||||
locationSortKeys(a, file, line, column) and
|
||||
name = a.toString()
|
||||
|
|
||||
a order by file, line, column
|
||||
a order by file, line, column, name
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ events.cs:
|
||||
# 6| 3: [AddEventAccessor] add_MyEvent
|
||||
#-----| 2: (Parameters)
|
||||
# 6| 0: [Parameter] value
|
||||
# 6| 3: [RemoveEventAccessor] remove_MyEvent
|
||||
# 6| 4: [RemoveEventAccessor] remove_MyEvent
|
||||
#-----| 2: (Parameters)
|
||||
# 6| 0: [Parameter] value
|
||||
# 8| 7: [InstanceConstructor] Events
|
||||
|
||||
@@ -50,6 +50,6 @@ Assignments.cs:
|
||||
# 23| 3: [AddEventAccessor] add_Event
|
||||
#-----| 2: (Parameters)
|
||||
# 23| 0: [Parameter] value
|
||||
# 23| 3: [RemoveEventAccessor] remove_Event
|
||||
# 23| 4: [RemoveEventAccessor] remove_Event
|
||||
#-----| 2: (Parameters)
|
||||
# 23| 0: [Parameter] value
|
||||
|
||||
@@ -189,7 +189,7 @@ NullableRefTypes.cs:
|
||||
# 48| 3: [AddEventAccessor] add_P
|
||||
#-----| 2: (Parameters)
|
||||
# 48| 0: [Parameter] value
|
||||
# 48| 3: [RemoveEventAccessor] remove_P
|
||||
# 48| 4: [RemoveEventAccessor] remove_P
|
||||
#-----| 2: (Parameters)
|
||||
# 48| 0: [Parameter] value
|
||||
# 51| 25: [Method] Q
|
||||
|
||||
@@ -178,7 +178,7 @@ definitions.cs:
|
||||
# 101| 3: [AddEventAccessor] add_Click
|
||||
#-----| 2: (Parameters)
|
||||
# 101| 0: [Parameter] value
|
||||
# 101| 3: [RemoveEventAccessor] remove_Click
|
||||
# 101| 4: [RemoveEventAccessor] remove_Click
|
||||
#-----| 2: (Parameters)
|
||||
# 101| 0: [Parameter] value
|
||||
# 103| 7: [Method] M
|
||||
@@ -257,7 +257,7 @@ definitions.cs:
|
||||
# 145| 3: [AddEventAccessor] add_EH
|
||||
#-----| 2: (Parameters)
|
||||
# 145| 0: [Parameter] value
|
||||
# 145| 3: [RemoveEventAccessor] remove_EH
|
||||
# 145| 4: [RemoveEventAccessor] remove_EH
|
||||
#-----| 2: (Parameters)
|
||||
# 145| 0: [Parameter] value
|
||||
# 146| 5: [Method] M
|
||||
|
||||
@@ -9,7 +9,7 @@ events.cs:
|
||||
# 13| 3: [AddEventAccessor] add_Click
|
||||
#-----| 2: (Parameters)
|
||||
# 13| 0: [Parameter] value
|
||||
# 13| 3: [RemoveEventAccessor] remove_Click
|
||||
# 13| 4: [RemoveEventAccessor] remove_Click
|
||||
#-----| 2: (Parameters)
|
||||
# 13| 0: [Parameter] value
|
||||
# 15| 6: [Method] OnClick
|
||||
|
||||
@@ -941,7 +941,7 @@ expressions.cs:
|
||||
# 229| 3: [AddEventAccessor] add_Click
|
||||
#-----| 2: (Parameters)
|
||||
# 229| 0: [Parameter] value
|
||||
# 229| 3: [RemoveEventAccessor] remove_Click
|
||||
# 229| 4: [RemoveEventAccessor] remove_Click
|
||||
#-----| 2: (Parameters)
|
||||
# 229| 0: [Parameter] value
|
||||
# 231| 6: [Method] OnClick
|
||||
|
||||
@@ -229,7 +229,7 @@ generics.cs:
|
||||
# 37| 3: [AddEventAccessor] add_myEvent
|
||||
#-----| 2: (Parameters)
|
||||
# 37| 0: [Parameter] value
|
||||
# 37| 3: [RemoveEventAccessor] remove_myEvent
|
||||
# 37| 4: [RemoveEventAccessor] remove_myEvent
|
||||
#-----| 2: (Parameters)
|
||||
# 37| 0: [Parameter] value
|
||||
# 39| 12: [IncrementOperator] ++
|
||||
|
||||
@@ -36,7 +36,7 @@ Members.cs:
|
||||
# 20| 3: [AddEventAccessor] add_Event
|
||||
#-----| 2: (Parameters)
|
||||
# 20| 0: [Parameter] value
|
||||
# 20| 3: [RemoveEventAccessor] remove_Event
|
||||
# 20| 4: [RemoveEventAccessor] remove_Event
|
||||
#-----| 2: (Parameters)
|
||||
# 20| 0: [Parameter] value
|
||||
# 24| 6: [Method] Method
|
||||
@@ -64,7 +64,7 @@ Members.cs:
|
||||
# 32| 3: [AddEventAccessor] add_Event
|
||||
#-----| 2: (Parameters)
|
||||
# 32| 0: [Parameter] value
|
||||
# 32| 3: [RemoveEventAccessor] remove_Event
|
||||
# 32| 4: [RemoveEventAccessor] remove_Event
|
||||
#-----| 2: (Parameters)
|
||||
# 32| 0: [Parameter] value
|
||||
# 35| 3: [Class] Class2
|
||||
@@ -99,7 +99,7 @@ Members.cs:
|
||||
# 43| 3: [AddEventAccessor] add_Event
|
||||
#-----| 2: (Parameters)
|
||||
# 43| 0: [Parameter] value
|
||||
# 43| 3: [RemoveEventAccessor] remove_Event
|
||||
# 43| 4: [RemoveEventAccessor] remove_Event
|
||||
#-----| 2: (Parameters)
|
||||
# 43| 0: [Parameter] value
|
||||
# 46| 6: [Method] Method
|
||||
@@ -127,7 +127,7 @@ Members.cs:
|
||||
# 50| 3: [AddEventAccessor] add_Event
|
||||
#-----| 2: (Parameters)
|
||||
# 50| 0: [Parameter] value
|
||||
# 50| 3: [RemoveEventAccessor] remove_Event
|
||||
# 50| 4: [RemoveEventAccessor] remove_Event
|
||||
#-----| 2: (Parameters)
|
||||
# 50| 0: [Parameter] value
|
||||
# 54| 4: [Interface] Interface
|
||||
@@ -151,7 +151,7 @@ Members.cs:
|
||||
# 59| 3: [AddEventAccessor] add_Event
|
||||
#-----| 2: (Parameters)
|
||||
# 59| 0: [Parameter] value
|
||||
# 59| 3: [RemoveEventAccessor] remove_Event
|
||||
# 59| 4: [RemoveEventAccessor] remove_Event
|
||||
#-----| 2: (Parameters)
|
||||
# 59| 0: [Parameter] value
|
||||
# 62| 5: [Interface] Interface2
|
||||
@@ -175,7 +175,7 @@ Members.cs:
|
||||
# 67| 3: [AddEventAccessor] add_Event
|
||||
#-----| 2: (Parameters)
|
||||
# 67| 0: [Parameter] value
|
||||
# 67| 3: [RemoveEventAccessor] remove_Event
|
||||
# 67| 4: [RemoveEventAccessor] remove_Event
|
||||
#-----| 2: (Parameters)
|
||||
# 67| 0: [Parameter] value
|
||||
# 71| 6: [Enum] Enum
|
||||
|
||||
Reference in New Issue
Block a user