C#: Alert suppression comments for lgtm[cs/catch-of-all-exceptions

This commit is contained in:
calum
2019-02-12 12:45:22 +00:00
parent fb8d0f5b1f
commit 1e1784239c
4 changed files with 6 additions and 6 deletions

View File

@@ -242,7 +242,7 @@ namespace Semmle.Autobuild
{
actions.DirectoryDelete(dir, true);
}
catch
catch // lgtm[cs/catch-of-all-exceptions]
{
return FailureCode;
}
@@ -262,7 +262,7 @@ namespace Semmle.Autobuild
{
actions.FileDelete(file);
}
catch
catch // lgtm[cs/catch-of-all-exceptions]
{
return FailureCode;
}

View File

@@ -367,7 +367,7 @@ namespace Semmle.Extraction.CIL.Entities
decoded = new Instruction(cx, this, ilbytes, offset, child++);
offset += decoded.Width;
}
catch
catch // lgtm[cs/catch-of-all-exceptions]
{
yield break;
}

View File

@@ -24,7 +24,7 @@ namespace Semmle.BuildAnalyser
// Microsoft.Build is not cross platform.
ReadMsBuildProject(filename);
}
catch
catch // lgtm[cs/catch-of-all-exceptions]
{
// There was some reason why the project couldn't be loaded.
// Fall back to reading the Xml document directly.

View File

@@ -175,7 +175,7 @@ namespace Semmle.Util
{
return GetRealPath(path);
}
catch
catch // lgtm[cs/catch-of-all-exceptions]
{
// File does not exist
return ConstructCanonicalPath(path, cache);
@@ -248,7 +248,7 @@ namespace Semmle.Util
(PathStrategy)new GetFinalPathNameByHandleStrategy() :
(PathStrategy)new PosixSymlinkStrategy();
}
catch (Exception)
catch // lgtm[cs/catch-of-all-exceptions]
{
// Failed to late-bind a suitable library.
logger.Log(Severity.Warning, "Preserving symlinks in canonical paths");