chore: clear redundant/dead-code InspectCode findings (tests + contract bases) - #393
Merged
Merged
Conversation
…ract bases Fixes the ~43 genuinely-redundant InspectCode findings the post-0.23.0 main scan surfaced (mostly in test projects and the shipped TestKit.Xunit contract-base helpers): - RedundantCast x30: dropped `(IProgress<TProgress>)`/`(IAsyncEnumerable<TItem>)` casts on `null!` null-guard arguments and lambda/ctor casts. Each verified to not change overload resolution (the only alternative overloads add a non-nullable CancellationToken, which `null` can't bind). - RedundantTypeArgumentsOfMethod, RedundantNameQualifier, RedundantWithCancellation, RedundantArgumentDefaultValue, RedundantAssignment: removed. - UnusedVariable/NotAccessedVariable: discarded unused `await foreach` vars and removed a write-only `capturedTimer`, preserving load-bearing side effects. - S4456: split the two-arg `ExtractAsync(progress, token)` test double into an eager-validating wrapper + iterator core, matching RetryingExtractor. The remaining findings are dismissed as false-positives or intentional test patterns (the `!` after Assert.NotNull needed on net462/netstandard2.0; usings inside an #if NET6_0_OR_GREATER file; finalizers that are the subject of FinalizationSuppressionTests; ThrowingDisposable doubles; CancelAsync which is net8+ only). Full-matrix Release build (net462..net10, warnings-as-errors) green; 1072 net8.0 tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
BenchmarkDotNet
Details
| Benchmark suite | Current: 9b90d6c | Previous: 23c2c32 | Ratio |
|---|---|---|---|
Wolfgang.Etl.Abstractions.Benchmarks.ExtractorBenchmarks.Extract_NoProgress(RecordCount: 1000) |
31519.81462605794 ns (± 80.06415714897399) |
31800.580780029297 ns (± 307.54830997169506) |
0.99 |
Wolfgang.Etl.Abstractions.Benchmarks.ExtractorBenchmarks.Extract_WithProgress(RecordCount: 1000) |
36102.14316813151 ns (± 867.8521154989195) |
36281.488749186195 ns (± 253.8979487087474) |
1.00 |
Wolfgang.Etl.Abstractions.Benchmarks.ExtractorBenchmarks.Extract_NoProgress(RecordCount: 100000) |
3185449.9921875 ns (± 5422.848856623841) |
3127990.4661458335 ns (± 11429.375798740686) |
1.02 |
Wolfgang.Etl.Abstractions.Benchmarks.ExtractorBenchmarks.Extract_WithProgress(RecordCount: 100000) |
3463994.1575520835 ns (± 10025.001237995582) |
3916759.8196614585 ns (± 15055.495493975353) |
0.88 |
Wolfgang.Etl.Abstractions.Benchmarks.PipelineBenchmarks.FluentPipeline(RecordCount: 1000) |
29236.966379801434 ns (± 95.99428971692627) |
29872.644785563152 ns (± 118.63128704029951) |
0.98 |
Wolfgang.Etl.Abstractions.Benchmarks.PipelineBenchmarks.ManualComposition(RecordCount: 1000) |
29092.47624206543 ns (± 114.36402145114212) |
28800.820571899414 ns (± 74.11664119421287) |
1.01 |
Wolfgang.Etl.Abstractions.Benchmarks.PipelineBenchmarks.BaseClassComposition(RecordCount: 1000) |
80485.62573242188 ns (± 167.063866298016) |
82518.81917317708 ns (± 99.99541646215732) |
0.98 |
Wolfgang.Etl.Abstractions.Benchmarks.PipelineBenchmarks.FluentPipeline(RecordCount: 100000) |
2838808.2760416665 ns (± 2016.475834747182) |
2845985.0143229165 ns (± 2552.770328339048) |
1.00 |
Wolfgang.Etl.Abstractions.Benchmarks.PipelineBenchmarks.ManualComposition(RecordCount: 100000) |
2894192.2200520835 ns (± 12242.488437136786) |
2865319.8111979165 ns (± 20383.721023751135) |
1.01 |
Wolfgang.Etl.Abstractions.Benchmarks.PipelineBenchmarks.BaseClassComposition(RecordCount: 100000) |
8092019.723958333 ns (± 3345.6680772877276) |
8191735.723958333 ns (± 1123.8189825546328) |
0.99 |
This comment was automatically generated by workflow using github-action-benchmark.
This was referenced Aug 16, 2026
Merged
This was referenced Aug 19, 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.
Clears the InspectCode code-scanning findings the post-0.23.0 main scan surfaced (67 total): fixes the genuinely-redundant/dead ones, dismisses the rest as false-positives or intentional test patterns. Fix-first per the agreed approach.
Fixed (~43, this PR)
(IProgress<TProgress>)/(IAsyncEnumerable<TItem>)casts onnull!null-guard args, plus lambda/ctor casts. Each verified not to change overload resolution (the only alternative overloads add a non-nullableCancellationToken, whichnullcan't bind).await foreachvars; removed a write-onlycapturedTimer(kept theElapsedsubscription).ExtractAsync(progress, token)test double into an eager-validating wrapper + iterator core (matchesRetryingExtractor).Dismissed on the dashboard (24 — code is correct)
!afterAssert.NotNull×8 — required on net462/netstandard2.0 (xUnit 2.9 lacks[NotNull]); redundant only on net8.0+.using×5 inAllocationRegressionTests— whole file is inside#if NET6_0_OR_GREATER; needed by the net6+ body.CancelAsync, which is net8+ only; library targets down to net462.FinalizationSuppressionTestsfinalizers are the subject under test.ThrowingDisposable*doubles throw fromDisposeon purpose.GetEnumerators return self.Verification
🤖 Generated with Claude Code