Skip to content

Commit 0cb2c09

Browse files
authored
Merge pull request #930 from calumgrant/cs/suppress-alerts
C#: Add some alert suppression comments
2 parents 1d4f894 + 1e17842 commit 0cb2c09

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

csharp/autobuilder/Semmle.Autobuild/BuildScript.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public static BuildScript DeleteDirectory(string dir) =>
242242
{
243243
actions.DirectoryDelete(dir, true);
244244
}
245-
catch
245+
catch // lgtm[cs/catch-of-all-exceptions]
246246
{
247247
return FailureCode;
248248
}
@@ -262,7 +262,7 @@ public static BuildScript DeleteFile(string file) =>
262262
{
263263
actions.FileDelete(file);
264264
}
265-
catch
265+
catch // lgtm[cs/catch-of-all-exceptions]
266266
{
267267
return FailureCode;
268268
}

csharp/extractor/Semmle.Extraction.CIL/Entities/Method.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ public IEnumerable<Instruction> DebugInstructions
367367
decoded = new Instruction(cx, this, ilbytes, offset, child++);
368368
offset += decoded.Width;
369369
}
370-
catch
370+
catch // lgtm[cs/catch-of-all-exceptions]
371371
{
372372
yield break;
373373
}

csharp/extractor/Semmle.Extraction.CSharp.Standalone/CsProjFile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public CsProjFile(FileInfo filename)
2424
// Microsoft.Build is not cross platform.
2525
ReadMsBuildProject(filename);
2626
}
27-
catch
27+
catch // lgtm[cs/catch-of-all-exceptions]
2828
{
2929
// There was some reason why the project couldn't be loaded.
3030
// Fall back to reading the Xml document directly.

csharp/extractor/Semmle.Util/CanonicalPathCache.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public override string GetCanonicalPath(string path, IPathCache cache)
175175
{
176176
return GetRealPath(path);
177177
}
178-
catch
178+
catch // lgtm[cs/catch-of-all-exceptions]
179179
{
180180
// File does not exist
181181
return ConstructCanonicalPath(path, cache);
@@ -248,7 +248,7 @@ public static CanonicalPathCache Create(ILogger logger, int maxCapacity, Symlink
248248
(PathStrategy)new GetFinalPathNameByHandleStrategy() :
249249
(PathStrategy)new PosixSymlinkStrategy();
250250
}
251-
catch (Exception)
251+
catch // lgtm[cs/catch-of-all-exceptions]
252252
{
253253
// Failed to late-bind a suitable library.
254254
logger.Log(Severity.Warning, "Preserving symlinks in canonical paths");

0 commit comments

Comments
 (0)