Repository navigation
fix: resolve sonar issues - #1183
Merged
Merged
Conversation
Since .NET 11 the BCL offers char overloads with a StringComparison parameter, so the analyzer flags the char-only calls. Pass StringComparison.Ordinal explicitly and add the missing IndexOf(char, int, StringComparison) polyfill for older frameworks. The EndsWith(char) polyfill in the compression package is no longer used and is removed. Also address the remaining mechanical findings: adjacent NextInt64 overloads, HasFlag instead of a bitwise check, a merged nested if, a nested ternary, a condition that is always true, string.Equals and a CancellationToken in tests, and CA1845 suppressions for netstandard2.0 compatible Substring concatenations, matching the existing pattern.
These findings are intentional or false positives, so suppress them where they occur with a short reason instead of keeping them only as accepted issues in SonarCloud: the wrapper mirrors `Path.GetTempFileName`, `FileInfoMock.Length` throws like the real property, the `FileSystemWatcherMock` reflection simulates the path separator of another OS, the span `Is` overloads of `ParameterDescription` check the recording subclass, extension properties cannot be static, and the `partial` test classes have a second part only on frameworks with async compression APIs.
vbreuss
enabled auto-merge (squash)
November 2, 2026 07:23
|
|
This pull request is merged. |
Test Results 80 files 80 suites 1h 38m 11s ⏱️ Results for commit 50b1aa2. |
|
This is addressed in release v8.0.0. |
This was referenced Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Resolves the open SonarCloud issues and replaces the accepted ones that are intentional or false positives with in-code suppressions, so the reason is visible next to the code instead of only in SonarCloud.
Fixed
StartsWith,EndsWith,IndexOfandLastIndexOfwith aStringComparisonparameter, so the char-only calls are flagged. They now passStringComparison.Ordinal, and the missingIndexOf(char, int, StringComparison)polyfill is added for older frameworks.EndsWith(char)polyfill in the compression package is no longer used and is removed.NextInt64overloads inIRandomandRandomWrapperare adjacent (reordering only, no API change).HasFlaginstead of a bitwise check, a merged nestedif, a nested ternary inExceptionFactory, a condition inInMemoryStoragethat was always true,string.Equalsand aCancellationTokenin tests.Substringconcatenations keep thenetstandard2.0compatible form with aCA1845suppression, matching the existing pattern inFileSystemInitializerExtensions.Suppressed with a reason
S5445:PathWrapper.GetTempFileNamehas to mirror the BCL.S2372:FileInfoMock.Lengththrows like the realFileInfo.Length.S3011: theFileSystemWatcherMockreflection is needed to simulate the path separator of another OS.S3060: the spanIsoverloads ofParameterDescriptioncheck the recording subclass.S2325: extension properties cannot be static.MA0204: thepartialcompression test classes have a second part only withFEATURE_COMPRESSION_ASYNC.