Skip to content

Commit

Permalink
SonarClooud S2076
Browse files Browse the repository at this point in the history
  • Loading branch information
axunonb committed Sep 28, 2024
1 parent 28f4eeb commit b158635
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 7 additions & 4 deletions League/Caching/HtmlToPdfConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

namespace League.Caching;

#pragma warning disable S2083 // reason: False positive due to CancellationToken in GetPdfDataBrowser
#pragma warning disable S2076 // reason: False positive due to CancellationToken in GetPdfDataBrowser
#pragma warning disable CA3003 // reason: False positive due to CancellationToken in GetPdfDataBrowser

/// <summary>
/// The class to create PDF files from HTML content.
/// For converting HTML to PDF, it uses either a Browser command line or <see cref="PuppeteerSharp"/>.
Expand Down Expand Up @@ -70,12 +74,8 @@ private void EnsureTempFolder(string tempFolder)
{
var tmpPdfFile = await CreatePdfDataBrowser(tmpHtmlPath, cancellationToken);

#pragma warning disable S2083 // reason: False positive due to CancellationToken in GetPdfDataBrowser
#pragma warning disable CA3003 // reason: False positive due to CancellationToken in GetPdfDataBrowser
if (tmpPdfFile != null && File.Exists(tmpPdfFile))
return await File.ReadAllBytesAsync(tmpPdfFile, cancellationToken);
#pragma warning restore S2083 // reason: False positive due to CancellationToken in GetPdfDataBrowser
#pragma warning restore CA3003 // reason: False positive due to CancellationToken in GetPdfDataBrowser

_logger.LogError("Error creating PDF file with Browser");
return null;
Expand Down Expand Up @@ -196,3 +196,6 @@ public void Dispose()
}
}

#pragma warning restore S2083 // reason: False positive due to CancellationToken in GetPdfDataBrowser
#pragma warning restore S2076 // reason: False positive due to CancellationToken in GetPdfDataBrowser
#pragma warning restore CA3003 // reason: False positive due to CancellationToken in GetPdfDataBrowser
2 changes: 2 additions & 0 deletions League/Caching/ReportSheetCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace League.Caching;

#pragma warning disable S2083 // reason: False positive due to CancellationToken in GetOrCreatePdf
#pragma warning disable S2076 // reason: False positive due to CancellationToken in GetOrCreatePdf
#pragma warning disable CA3003 // reason: False positive due to CancellationToken in GetOrCreatePdf

/// <summary>
Expand Down Expand Up @@ -125,4 +126,5 @@ private static string CreateTempPathFolder()
}
}
#pragma warning restore CA3003
#pragma warning disable S2076
#pragma warning restore S2083

0 comments on commit b158635

Please sign in to comment.