From 07a5c203092ddecced3fa688c58e3fa401a5b01c Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Tue, 20 Aug 2024 14:35:31 +0200 Subject: [PATCH] Fix/add doc comments --- .../NugetPackageRestorer.cs | 7 ++++--- csharp/extractor/Semmle.Util/FileUtils.cs | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs index 9ce61b633ba..3895db3e4d4 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs @@ -771,15 +771,16 @@ namespace Semmle.Extraction.CSharp.DependencyFetching } /// - /// Computes a unique temp directory for the packages associated - /// with this source tree. Use a SHA1 of the directory name. + /// Returns the full path to a temporary directory with the given subfolder name. /// - /// The full path of the temp directory. private static string ComputeTempDirectoryPath(string subfolderName) { return Path.Combine(FileUtils.GetTemporaryWorkingDirectory(out _), subfolderName); } + /// + /// Computes a unique temporary directory path based on the source directory and the subfolder name. + /// private static string ComputeTempDirectoryPath(string srcDir, string subfolderName) { return Path.Combine(FileUtils.GetTemporaryWorkingDirectory(out _), FileUtils.ComputeHash(srcDir), subfolderName); diff --git a/csharp/extractor/Semmle.Util/FileUtils.cs b/csharp/extractor/Semmle.Util/FileUtils.cs index d5930251fae..0b63082ce6d 100644 --- a/csharp/extractor/Semmle.Util/FileUtils.cs +++ b/csharp/extractor/Semmle.Util/FileUtils.cs @@ -86,7 +86,7 @@ namespace Semmle.Util } /// - /// Computes the hash of . + /// Computes the hash of the file at . /// public static string ComputeFileHash(string filePath) { @@ -95,6 +95,9 @@ namespace Semmle.Util return GetHashString(sha); } + /// + /// Computes the hash of . + /// public static string ComputeHash(string input) { var bytes = Encoding.Unicode.GetBytes(input);