FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

build: adopt SecuritySharp and PerformanceSharp analyzers and refresh dependencies by glennawatson · Pull Request #1651 · reactiveui/splat · GitHub

build: adopt SecuritySharp and PerformanceSharp analyzers and refresh dependencies - #1651

Merged
glennawatson merged 9 commits into
mainfrom
build/adopt-security-performance-analyzers
Jul 23, 2026
Merged

build: adopt SecuritySharp and PerformanceSharp analyzers and refresh dependencies#1651
glennawatson merged 9 commits into
mainfrom
build/adopt-security-performance-analyzers

Conversation

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Build / tooling and the code changes needed to satisfy it: adopts the StyleSharp / PerformanceSharp / SecuritySharp analyzer suite, refreshes the shared .editorconfig, updates NuGet dependencies, and fixes every resulting analyzer finding.

What is the new behavior?

  • Adopts the full analyzer suite. Adds SecuritySharp.Analyzers and PerformanceSharp.Analyzers, and bumps StyleSharp.Analyzers to 3.38.1 (the three ship from one pipeline and share a version). They are referenced for every project alongside the existing analyzers.
  • Adapts the .editorconfig from ReactiveUI. Brings over the shared, suite-aware configuration, keeping Splat's own file header and its Platforms/TypeForwardedSystemDrawing.cs (RS0041) exemption. Overlapping legacy analyzer rules are pointed at the suite's canonical rule and a handful are scoped to none where they describe a deliberate Splat pattern (the allocation-free logging overloads, marker/tag interfaces, retained obsolete APIs, generic-cache factory methods, and the generic service-locator API).
  • Updates NuGet dependencies to their latest compatible stable versions (checked against nuget.org, obeying the per-TFM constraints already encoded in the packages file): ReactiveUI.Disposables 7.0.0, Serilog 4.4.0, TUnit 1.61.29, Verify.TUnit 31.27.0, the Microsoft.Extensions.* / System.* 10.0.10 set, SourceLink 10.0.301, Raygun 11.2.6, and the analyzer bumps above. Prereleases were skipped in favor of the latest stable.
  • Fixes every analyzer finding across product and test code rather than suppressing it. Where an existing suppression targeted a legacy rule that the suite now supersedes, the suppression is swapped to the canonical suite rule (or removed when its twin is disabled). Highlights: the generic service-locator / logging APIs carry justified type-level suppressions (the type parameter is the caller-supplied contract by design); interlocked-field reads use Volatile.Read; dictionary get-or-add uses CollectionsMarshal.GetValueRefOrAddDefault on net6+; SplatColor is now genuinely immutable; a System.Index polyfill is added for the net4x from-end-index usages; test methods that asserted nothing gained real assertions. Files were re-saved as UTF-8 without a BOM.

What is the current behavior?

Only StyleSharp.Analyzers (3.5.2) from the suite was referenced; the .editorconfig predated the suite migration; several dependencies were behind their latest stable.

What might this PR break?

  • Microsoft.ApplicationInsights is intentionally held at 2.23.0, not the 3.x latest. AI 3.x removed PageViewTelemetry, which Splat.ApplicationInsights exposes on its public API (OnViewNavigation(PageViewTelemetry) / GetPageViewTelemetry()); adopting 3.x would be a breaking change to Splat's own public surface, so the bump was reverted. Every other package went to its latest compatible stable.
  • Numerous internal members were tightened from public to internal (their containing type is not public) — no public API change.
  • One test-support parameter was renamed to match its base member; the tracked PublicAPI.Shipped.txt files were updated to match.
  • All source files are now UTF-8 without a BOM.
  • Changes are intended to be behavior-preserving; the full test suite passes.

Additional information

  • The full solution builds clean (-warnaserror) across every target framework the host can build: net8/9/10/11, net462/472/481 (reference), net*-android, and net*-windows.
  • The entire test suite passes.

… dependencies

- Add SecuritySharp.Analyzers and PerformanceSharp.Analyzers; bump
  StyleSharp.Analyzers to 3.38.1 (the three share one suite release)
- Adapt the shared .editorconfig to the suite, keeping Splat's file header
  and the Platforms RS0041 exemption
- Update NuGet packages to their latest compatible stable versions, obeying
  the per-TFM constraints in the packages file; hold Microsoft.ApplicationInsights
  at 2.23.0 (3.x removes PageViewTelemetry from Splat.ApplicationInsights' public API)
- Fix every resulting analyzer finding across product and test code rather than
  suppressing it; add real assertions to no-assertion tests; save sources as UTF-8
  without a BOM
Copilot AI review requested due to automatic review settings July 23, 2026 02:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

This PR updates the repo’s build/tooling by adopting the full StyleSharp/PerformanceSharp/SecuritySharp analyzer suite, refreshing analyzer configuration, bumping dependencies, and applying the resulting analyzer-driven fixes across product and test code.

Changes:

  • Added PerformanceSharp and SecuritySharp analyzers (and updated StyleSharp) for all projects via central build props.
  • Performed broad analyzer-driven refactors (static lambdas, tightened visibilities, disposal patterns, minor perf tweaks) across core libraries and tests.
  • Updated/adjusted public API tracking files where analyzer-driven signature/parameter-name changes required it.

Reviewed changes

Copilot reviewed 264 out of 265 changed files in this pull request and generated 6 comments.

Show a summary per file Changed files
File Description
src/tests/Splat.Tests/ServiceLocation/ResolverMixinsTests.cs Analyzer-driven updates (static lambda, discard fluent result).
src/tests/Splat.Tests/ServiceLocation/NullServiceTypeTests.cs Analyzer-driven updates (static lambdas).
src/tests/Splat.Tests/ServiceLocation/NestedResolutionProbe.cs Tightened accessibility for test helper.
src/tests/Splat.Tests/ServiceLocation/ModernDependencyResolverTests.cs Analyzer-driven updates (static lambdas).
src/tests/Splat.Tests/ServiceLocation/InstanceGenericFirst/InstanceGenericFirstDependencyResolverTests.cs Analyzer-driven updates (static lambdas, using declarations).
src/tests/Splat.Tests/ServiceLocation/GlobalGenericFirst/RegistrationTests.cs Analyzer-driven updates (static lambdas).
src/tests/Splat.Tests/ServiceLocation/GlobalGenericFirst/GlobalGenericFirstDependencyResolverTests.cs Analyzer-driven updates (static lambdas, using declarations).
src/tests/Splat.Tests/ServiceLocation/GlobalGenericFirst/ContainerTests.cs Analyzer-driven updates (static lambdas, discards).
src/tests/Splat.Tests/ServiceLocation/DependencyResolverMixinsTests.cs Analyzer-driven updates (static lambdas, discard).
src/tests/Splat.Tests/ServiceLocation/Common/TypeCacheTests.cs Adjusted test types/suppressions for new analyzers.
src/tests/Splat.Tests/ServiceLocation/AppLocatorTests.cs Analyzer-driven updates (static lambdas, discards).
src/tests/Splat.Tests/RectEdgeTests.cs Refactored constants/float literals for analyzers.
src/tests/Splat.Tests/ModeDetection/DefaultModeDetectorTests.cs Refactored env-var constants/static lambdas; tightened assertions.
src/tests/Splat.Tests/AssemblyInfo.cs UTF-8/BOM normalization.
src/tests/Splat.Tests/ApplicationPerformanceMonitoring/FuncFeatureUsageTrackingManagerCoverageTests.cs Analyzer-driven updates (static lambdas).
src/tests/Splat.Tests/ApplicationPerformanceMonitoring/EnableFeatureUsageTrackingExtensionsCoverageTests.cs Reduced string duplication; static lambdas.
src/tests/Splat.Tests/ApplicationPerformanceMonitoring/DefaultFeatureUsageTrackingSessionCoverageTests.cs Analyzer-driven updates (static lambdas).
src/tests/Splat.SimpleInjector.Tests/DependencyResolverTests.cs Disposal/analyzer-driven edits (contains await using issue).
src/tests/Splat.Serilog.Tests/SerilogSplatModuleCoverageTests.cs Added using scope for resolver disposal.
src/tests/Splat.Serilog.Tests/SerilogLoggerTests.cs Moved mappings into nested sink to satisfy analyzers.
src/tests/Splat.NLog.Tests/NLogLoggerTests.cs Refactored mappings location/name; BOM normalization.
src/tests/Splat.NLog.Tests/NLogLoggerCoverageTests.cs Refactored mappings location/name; static lambdas.
src/tests/Splat.NLog.Tests/MutableDependencyResolverExtensionsCoverageTests.cs Added using scope for resolver disposal; static lambdas.
src/tests/Splat.Ninject.Tests/DependencyResolverTests.cs Analyzer-driven discards/renames/static lambdas.
src/tests/Splat.Microsoft.Extensions.Logging.Tests/MicrosoftExtensionsLogProviderCoverageTests.cs Reduced string duplication; renamed params for analyzers; static lambdas.
src/tests/Splat.Microsoft.Extensions.Logging.Tests/MicrosoftExtensionsLoggingLoggerTests.cs Moved mappings into nested mock to satisfy analyzers; BOM normalization.
src/tests/Splat.Microsoft.Extensions.Logging.Tests/MicrosoftExtensionsLoggingExtensionsCoverageTests.cs Added using scope for resolver disposal; discards.
src/tests/Splat.Microsoft.Extensions.DependencyInjection.Tests/ContainerWrapper.cs Tightened accessibility of test helper members.
src/tests/Splat.Logging.Tests/WrappingPrefixLoggerCoverageTests.cs Target-typed new() for exceptions.
src/tests/Splat.Logging.Tests/WrappingFullLoggers/ConsoleLoggerTests.cs Logged caught exception to Debug to satisfy analyzer guidance.
src/tests/Splat.Logging.Tests/SplatLogManagerModuleCoverageTests.cs Analyzer-driven updates (static lambdas).
src/tests/Splat.Logging.Tests/SplatLoggerModuleCoverageTests.cs Analyzer-driven updates (static lambdas).
src/tests/Splat.Logging.Tests/NullLoggerTests.cs Target-typed new() for exceptions.
src/tests/Splat.Logging.Tests/LogManagerTests.cs Analyzer-driven updates (static lambdas).
src/tests/Splat.Logging.Tests/LogHostCoverageTests.cs Static lambdas; adjusted assertions for analyzers.
src/tests/Splat.Logging.Tests/DebugLoggerTests.cs Target-typed new() for exceptions.
src/tests/Splat.Logging.Tests/DebugLoggerCoverageTests.cs Target-typed new() for exceptions.
src/tests/Splat.Logging.Tests/ActionLoggerCoverageTests.cs Target-typed new() for exceptions.
src/tests/Splat.Log4Net.Tests/MutableDependencyResolverExtensionsCoverageTests.cs Added using scope for resolver disposal; static lambdas.
src/tests/Splat.Exceptionless.Tests/MutableDependencyResolverExtensionsCoverageTests.cs Added using scope for resolver disposal; static lambdas.
src/tests/Splat.Exceptionless.Tests/ExceptionlessViewTrackingCoverageTests.cs Analyzer-driven updates (static lambdas).
src/tests/Splat.Exceptionless.Tests/ExceptionlessSplatModuleCoverageTests.cs Analyzer-driven updates (static lambdas).
src/tests/Splat.Exceptionless.Tests/ExceptionlessLoggerTests.cs Discarded return value; BOM normalization.
src/tests/Splat.Exceptionless.Tests/ExceptionlessFeatureUsageTrackingSessionTests.cs BOM normalization.
src/tests/Splat.Exceptionless.Tests/ExceptionlessFeatureUsageTrackingSessionCoverageTests.cs Analyzer-driven updates (static lambdas).
src/tests/Splat.Drawing.Tests/ServiceLocationDrawingInitializationExtensionsCoverageTests.cs Updated assertion lambdas for analyzers.
src/tests/Splat.Drawing.Tests/PlatformBitmapLoaderTests.cs Added suppression for conditionally-empty test type.
src/tests/Splat.Drawing.Tests/BitmapLoaderCoverageTests.cs Static lambda update; simplified Stream type usage.
src/tests/Splat.Common.Test/ViewTwo.cs BOM normalization.
src/tests/Splat.Common.Test/ViewThatShouldNotLoad.cs BOM normalization.
src/tests/Splat.Common.Test/ViewOne.cs BOM normalization.
src/tests/Splat.Common.Test/ViewModelTwo.cs Added suppression for intentionally-empty type.
src/tests/Splat.Common.Test/ViewModelOne.cs BOM normalization.
src/tests/Splat.Common.Test/TextLogger.cs BOM normalization.
src/tests/Splat.Common.Test/PlatformModeDetectorScope.cs Refactored tuple state to named fields for analyzers.
src/tests/Splat.Common.Test/ModeDetectorScope.cs Refactored tuple state to named fields for analyzers.
src/tests/Splat.Common.Test/MockScreen.cs BOM normalization.
src/tests/Splat.Common.Test/IViewModelOne.cs Removed marker-interface suppression (suite migration).
src/tests/Splat.Common.Test/IViewFor{T}.cs BOM normalization.
src/tests/Splat.Common.Test/IViewFor.cs BOM normalization.
src/tests/Splat.Common.Test/IScreen.cs BOM normalization; removed marker-interface suppression.
src/tests/Splat.Common.Test/InternalLocatorScope.cs Tightened accessibility for helper property.
src/tests/Splat.Common.Test/IMockLogTarget.cs BOM normalization.
src/tests/Splat.Common.Test/IDummyInterface.cs BOM normalization; removed marker-interface suppression.
src/tests/Splat.Common.Test/FormatHelper.cs BOM normalization.
src/tests/Splat.Common.Test/DummyObjectClass3.cs BOM normalization.
src/tests/Splat.Common.Test/DummyObjectClass2.cs BOM normalization.
src/tests/Splat.Common.Test/DummyObjectClass1.cs BOM normalization.
src/tests/Splat.Common.Test/AppBuilderScope.cs Refactored tuple state to named fields for analyzers.
src/tests/Splat.Builder.Tests/SplatBuilderExtensionsTests.cs Analyzer-driven discards/static lambdas.
src/tests/Splat.Builder.Tests/AppBuilderTests.cs Analyzer-driven discards/static lambdas.
src/tests/Splat.ApplicationInsights.Tests/ApplicationInsightsViewTrackingTests.cs BOM normalization.
src/tests/Splat.ApplicationInsights.Tests/ApplicationInsightsFeatureUsageTrackingSessionTests.cs BOM normalization.
src/Splat/TargetFrameworkExtensions.cs BOM normalization.
src/Splat/ServiceLocation/ServiceLocationInitializationExtensions.cs Static lambda for default registrations.
src/Splat/ServiceLocation/Locator.cs Static lambda for resolver initializer hook.
src/Splat/ServiceLocation/FuncDependencyResolver.cs Perf/analysis-driven updates (CollectionsMarshal, debug logging on caught exceptions, cleanup).
src/Splat/ModeDetection/ModeDetector.cs BOM normalization.
src/Splat/ModeDetection/Mode.cs BOM normalization.
src/Splat/ModeDetection/IModeDetector.cs BOM normalization.
src/Splat/Maths/RectEdge.cs BOM normalization.
src/Splat/Maths/RectangleMathExtensions.cs Refactored Divide to switch expression; float literal casing.
src/Splat/Maths/PointMathExtensions.cs Minor perf/readability refactor (constant reuse, float literal casing).
src/Splat/AssemblyFinder.cs Tightened visibility; modern string interpolation; analyzer suppression migration.
src/Splat/ApplicationPerformanceMonitoring/IViewTracking.cs BOM normalization.
src/Splat/ApplicationPerformanceMonitoring/IFeatureUsageTrackingSession{TReferenceType}.cs BOM normalization.
src/Splat/ApplicationPerformanceMonitoring/IFeatureUsageTrackingSession.cs BOM normalization.
src/Splat/ApplicationPerformanceMonitoring/IFeatureUsageTrackingManager.cs BOM normalization.
src/Splat/ApplicationPerformanceMonitoring/IEnableFeatureUsageTracking.cs Removed marker-interface suppression; BOM normalization.
src/Splat/ApplicationPerformanceMonitoring/FuncFeatureUsageTrackingManager.cs BOM normalization.
src/Splat/ApplicationPerformanceMonitoring/EnableFeatureUsageTrackingExtensions.cs Removed suppression; analyzer suite migration.
src/Splat/ApplicationPerformanceMonitoring/DefaultFeatureUsageTrackingSession.cs Static lambda for log message factory.
src/Splat/ApplicationPerformanceMonitoring/DefaultFeatureUsageTrackingManager.cs Static lambda for session factory.
src/Splat.SimpleInjector/TransientSimpleInjectorRegistration.cs BOM normalization.
src/Splat.SimpleInjector/SplatSimpleInjectorExtensions.cs BOM normalization.
src/Splat.SimpleInjector/SimpleInjectorDependencyResolver.cs Analyzer-driven updates (static factory, generic API suppression migration, inferred generic calls).
src/Splat.Serilog/SerilogHelper.cs Tightened accessibility of internal helpers.
src/Splat.Serilog/SerilogFullLogger.Warn.cs NET8+ CompositeFormat path to satisfy performance analyzers.
src/Splat.Serilog/SerilogFullLogger.Info.cs NET8+ CompositeFormat path to satisfy performance analyzers.
src/Splat.Serilog/SerilogFullLogger.Fatal.cs NET8+ CompositeFormat path to satisfy performance analyzers.
src/Splat.Serilog/SerilogFullLogger.Error.cs NET8+ CompositeFormat path to satisfy performance analyzers.
src/Splat.Serilog/SerilogFullLogger.cs CompositeFormat caching; minor signature/parameter-name adjustments; suppression migration.
src/Splat.Serilog/PublicAPI/net8.0/PublicAPI.Shipped.txt Updated tracked public API signature text.
src/Splat.Serilog/PublicAPI/net9.0/PublicAPI.Shipped.txt Updated tracked public API signature text.
src/Splat.Serilog/PublicAPI/net10.0/PublicAPI.Shipped.txt Updated tracked public API signature text.
src/Splat.Serilog/PublicAPI/net11.0/PublicAPI.Shipped.txt Updated tracked public API signature text.
src/Splat.Serilog/PublicAPI/net462/PublicAPI.Shipped.txt Updated tracked public API signature text.
src/Splat.Serilog/PublicAPI/net472/PublicAPI.Shipped.txt Updated tracked public API signature text.
src/Splat.Serilog/PublicAPI/net481/PublicAPI.Shipped.txt Updated tracked public API signature text.
src/Splat.Serilog/MutableDependencyResolverExtensions.cs Doc example formatting; static lambda; analyzer-driven cleanup.
src/Splat.Raygun/RaygunFeatureUsageTrackingSession.cs BOM normalization.
src/Splat.Prism/SplatContainerExtension.cs Static lambda + static LINQ selector for analyzers.
src/Splat.NLog/NLogLogger.cs Suppression migration; BOM normalization.
src/Splat.NLog/MutableDependencyResolverExtensions.cs Doc example formatting; static lambda.
src/Splat.NLog/LogResolver.cs Tightened visibility; static cache delegate.
src/Splat.Ninject/SplatNinjectExtensions.cs BOM normalization.
src/Splat.Microsoft.Extensions.Logging/MsLoggingHelpers.cs Tightened visibility; static selector lambdas.
src/Splat.Microsoft.Extensions.Logging/MicrosoftExtensionsLogProvider.cs Removed redundant suppressions for unused field.
src/Splat.Microsoft.Extensions.Logging/MicrosoftExtensionsLoggingLogger.cs BOM normalization.
src/Splat.Microsoft.Extensions.Logging/MicrosoftExtensionsLoggingExtensions.cs Reordered/added extension blocks; doc example formatting; analyzer-driven cleanup.
src/Splat.Microsoft.Extensions.DependencyInjection/SplatMicrosoftExtensions.cs BOM normalization.
src/Splat.Logging/StaticFullLogger.cs Removed now-redundant suppression import/attribute.
src/Splat.Logging/NullLogger.cs BOM normalization.
src/Splat.Logging/MemoizingMRUCache.cs Minor refactor for analyzers; small loop write-style tweak.
src/Splat.Logging/LogManagerExtensions.cs Suppression migration.
src/Splat.Logging/LogLevel.cs BOM normalization.
src/Splat.Logging/LogHost.cs BOM normalization.
src/Splat.Logging/LoggingException.cs BOM normalization.
src/Splat.Logging/IStaticFullLogger.cs Added/updated suppressions for new analyzer suite.
src/Splat.Logging/ILogManager.cs BOM normalization.
src/Splat.Logging/ILogger.cs BOM normalization.
src/Splat.Logging/IEnableLogger.cs Removed marker-interface suppression; BOM normalization.
src/Splat.Logging/IAllocationFreeLogger.cs Removed suppression now handled by suite config.
src/Splat.Logging/IAllocationFreeErrorLogger.cs Removed suppression now handled by suite config.
src/Splat.Logging/FuncLogManager.cs BOM normalization.
src/Splat.Logging/DefaultLogManager.cs BOM normalization.
src/Splat.Logging/DebugLogger.cs BOM normalization.
src/Splat.Logging/AllocationFreeLoggerBase.cs Added suppression for abstract-without-abstract-members.
src/Splat.Logging/ActionLogger.cs BOM normalization.
src/Splat.Log4Net/MutableDependencyResolverExtensions.cs Doc example formatting; static lambda.
src/Splat.Log4Net/LogResolver.cs Tightened visibility; static cache delegate.
src/Splat.Log4Net/Log4NetLogger.cs BOM normalization.
src/Splat.Exceptionless/MutableDependencyResolverExtensions.cs Doc example formatting; BOM normalization.
src/Splat.Exceptionless/ExceptionlessViewTracking.cs BOM normalization.
src/Splat.Exceptionless/ExceptionlessSplatLogger.cs BOM normalization.
src/Splat.Exceptionless/ExceptionlessFeatureUsageTrackingSession.cs BOM normalization.
src/Splat.DryIoc/SplatDryIocExtensions.cs BOM normalization.
src/Splat.Drawing/Platforms/TypeForwardedSystemDrawing.cs BOM normalization.
src/Splat.Drawing/Platforms/ServiceLocationDrawingInitializationExtensions.cs Platform bitmap-loader registration changed (contains behavioral regression).
src/Splat.Drawing/Platforms/netcoreapp3/Bitmaps/PlatformBitmapLoader.cs BOM normalization.
src/Splat.Drawing/Platforms/netcoreapp3/Bitmaps/BitmapSourceBitmap.cs BOM normalization.
src/Splat.Drawing/Platforms/net6/Maths/SizeExtensions.cs Reordered extension blocks.
src/Splat.Drawing/Platforms/net6/Maths/RectExtensions.cs Reordered extension blocks (contains doc-comment mismatch).
src/Splat.Drawing/Platforms/net6/Maths/PointExtensions.cs Reordered extension blocks.
src/Splat.Drawing/Platforms/net6/Colors/SplatColorExtensions.cs Reordered extension blocks.
src/Splat.Drawing/Platforms/net6/Colors/ColorExtensions.cs Reordered extension blocks (contains doc-comment mismatch).
src/Splat.Drawing/Platforms/net6/Bitmaps/PlatformBitmapLoader.cs Extracted constants for analyzers; minor refactor.
src/Splat.Drawing/Platforms/net6/Bitmaps/BitmapSourceBitmap.cs Tightened accessibility; extracted constants.
src/Splat.Drawing/Platforms/net4/Maths/SizeExtensions.cs Reordered extension blocks.
src/Splat.Drawing/Platforms/net4/Maths/RectExtensions.cs Reordered extension blocks (contains doc-comment mismatch).
src/Splat.Drawing/Platforms/net4/Maths/PointExtensions.cs Reordered extension blocks.
src/Splat.Drawing/Platforms/net4/Colors/SplatColorExtensions.cs Reordered extension blocks.
src/Splat.Drawing/Platforms/net4/Colors/ColorExtensions.cs Reordered extension blocks (contains doc-comment mismatch).
src/Splat.Drawing/Platforms/net4/Bitmaps/PlatformBitmapLoader.cs Extracted constants for analyzers; minor refactor.
src/Splat.Drawing/Platforms/net4/Bitmaps/BitmapSourceBitmap.cs Tightened accessibility; extracted constants; float literal casing.
src/Splat.Drawing/Platforms/Cocoa/Bitmaps/PlatformBitmapLoader.cs BOM normalization.
src/Splat.Drawing/Platforms/Cocoa/Bitmaps/CocoaBitmap.cs BOM normalization.
src/Splat.Drawing/Platforms/BindingFlags.cs BOM normalization.
src/Splat.Drawing/Platforms/Android/Maths/RectExtensions.cs Reordered extension blocks.
src/Splat.Drawing/Platforms/Android/Maths/PointExtensions.cs Reordered extension blocks.
src/Splat.Drawing/Platforms/Android/Colors/SplatColorExtensions.cs Reordered extension blocks.
src/Splat.Drawing/Platforms/Android/Colors/ColorExtensions.cs Reordered extension blocks.
src/Splat.Drawing/Platforms/Android/Bitmaps/DrawableBitmap.cs Volatile reads for disposed field access.
src/Splat.Drawing/Platforms/Android/Bitmaps/BitmapMixins.cs Reordered extension blocks.
src/Splat.Drawing/Platforms/Android/Bitmaps/AndroidBitmap.cs Volatile reads + local capture for thread-safety analyzers.
src/Splat.Drawing/DefaultPlatformModeDetector.cs Variable renames for analyzers.
src/Splat.Drawing/Colors/SplatColor.KnownColors.cs BOM normalization.
src/Splat.Drawing/Colors/KnownColor.cs Updated enum XML docs for analyzers.
src/Splat.Drawing/Bitmaps/IBitmapLoader.cs BOM normalization.
src/Splat.Drawing/Bitmaps/IBitmap.cs BOM normalization.
src/Splat.Drawing/Bitmaps/CompressedBitmapFormat.cs BOM normalization.
src/Splat.Drawing/Bitmaps/BitmapLoaderException.cs BOM normalization.
src/Splat.Drawing/Bitmaps/BitmapLoader.cs BOM normalization.
src/Splat.Core/ServiceLocation/ResolverMixins.cs Static lambdas; suppression migration.
src/Splat.Core/ServiceLocation/NullServiceType.cs BOM normalization.
src/Splat.Core/ServiceLocation/IServiceLocator.cs Suppression migration.
src/Splat.Core/ServiceLocation/IReadonlyDependencyResolver.cs Suppression migration; BOM normalization.
src/Splat.Core/ServiceLocation/InternalLocator.cs Tightened accessibility; volatile/read changes for analyzers.
src/Splat.Core/ServiceLocation/InstanceGenericFirst/ResolverState.cs Tightened accessibility for internal-only members.
src/Splat.Core/ServiceLocation/InstanceGenericFirst/ContainerCache.cs Tightened accessibility; ^1 indexing; analyzers.
src/Splat.Core/ServiceLocation/IMutableDependencyResolver.cs Suppression migration; BOM normalization.
src/Splat.Core/ServiceLocation/IDependencyResolver.cs BOM normalization.
src/Splat.Core/ServiceLocation/GlobalGenericFirst/Container.cs Tightened accessibility; ^1 indexing; analyzers.
src/Splat.Core/ServiceLocation/Common/TypeCache.cs Tightened accessibility.
src/Splat.Core/ServiceLocation/Common/Registration.cs Tightened accessibility for internal helper struct/methods.
src/Splat.Core/ServiceLocation/AppLocator.cs Static lambda default; suppression migration.
src/Splat.Core/IAppInstance.cs BOM normalization.
src/Splat.Core/IAppBuilder.cs BOM normalization.
src/Splat.Builder/AppBuilder.cs Static lambdas; discard unused fluent return; analyzers.
src/Splat.Autofac/SplatAutofacExtensions.cs BOM normalization.
src/Splat.Autofac/Builder/AutofacSplatModule.cs Discarded unused return value.
src/Splat.ApplicationInsights/ApplicationInsightsViewTracking.cs BOM normalization.
src/Splat.ApplicationInsights/ApplicationInsightsFeatureUsageTrackingSession.cs BOM normalization.
src/Polyfills/UnconditionalSuppressMessageAttribute.cs Added suppression for accessibility vs containing type.
src/Polyfills/RequiresUnreferencedCodeAttribute.cs Added suppression for accessibility vs containing type.
src/Polyfills/ObjectDisposedExceptionHelper.cs Tightened accessibility.
src/Polyfills/MaybeNullWhenAttribute.cs Added suppression for accessibility vs containing type.
src/Polyfills/IsExternalInit.cs Added suppression for intentionally-empty marker type.
src/Polyfills/DynamicallyAccessedMemberTypes.cs Updated suppression to suite rule.
src/Polyfills/DynamicallyAccessedMembersAttribute.cs Added suppression for accessibility vs containing type.
src/Polyfills/DoesNotReturnIfAttribute.cs Added suppression for accessibility vs containing type.
src/Polyfills/CallerArgumentExpressionAttribute.cs Added suppression for accessibility vs containing type.
src/Polyfills/ArgumentOutOfRangeExceptionHelper.cs Tightened accessibility.
src/Polyfills/ArgumentGuard.cs Tightened accessibility.
src/Polyfills/ArgumentExceptionHelper.cs Tightened accessibility.
src/Directory.Build.props Added PerformanceSharp and SecuritySharp analyzer package references.
src/Benchmarks/src/ViewModel.cs BOM normalization.
src/Benchmarks/src/Program.cs BOM normalization.
Comments suppressed due to low confidence (4)

src/tests/Splat.SimpleInjector.Tests/DependencyResolverTests.cs:50

  • await using requires IAsyncDisposable/DisposeAsync(). SimpleInjector.Container (SimpleInjector 5.6.0) is IDisposable, so this will not compile; use a normal using declaration instead.
    src/tests/Splat.SimpleInjector.Tests/DependencyResolverTests.cs:65
  • await using requires IAsyncDisposable/DisposeAsync(). SimpleInjector.Container (SimpleInjector 5.6.0) is IDisposable, so this will not compile; use a normal using declaration instead.
    src/tests/Splat.SimpleInjector.Tests/DependencyResolverTests.cs:92
  • await using requires IAsyncDisposable/DisposeAsync(). SimpleInjector.Container (SimpleInjector 5.6.0) is IDisposable, so this will not compile; use a normal using declaration instead.
    src/tests/Splat.SimpleInjector.Tests/DependencyResolverTests.cs:108
  • await using requires IAsyncDisposable/DisposeAsync(). SimpleInjector.Container (SimpleInjector 5.6.0) is IDisposable, so this will not compile; use a normal using declaration instead.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The Apple (Cocoa) platform files and the Windows-target test build were not
reachable from the Linux multi-TFM build, so these only surfaced on CI:

- Cocoa CocoaBitmap/PlatformBitmapLoader/SplatColorExtensions: Volatile.Read on
  the interlocked field (snapshotting for the closure), delete redundant
  suppressions, RunContinuationsAsynchronously on the TaskCompletionSource,
  observe-then-throw null fallbacks, interpolated strings, uppercase float
  suffix, extension-block ordering, and drop the unused UIApplication alias
- BitmapLoaderCoverageTests: add the explicit System.IO using so Stream resolves
  on the Windows target frameworks (their implicit usings omit it)
Copilot AI review requested due to automatic review settings July 23, 2026 09:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

Copilot reviewed 265 out of 266 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/Splat.Drawing/Platforms/ServiceLocationDrawingInitializationExtensions.cs:19

  • RegisterPlatformBitmapLoader no longer registers an IBitmapLoader; it only validates resolver. This turns a public initialization API into a no-op and will silently break consumers expecting the platform bitmap loader to be available after calling it.

codecov Bot commented Jul 23, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.53086% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.95%. Comparing base (b146a3c) to head (af4ef93).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...nericFirst/GlobalGenericFirstDependencyResolver.cs 95.65% 0 Missing and 1 partial ⚠️
...Location/GlobalGenericFirst/ServiceTypeRegistry.cs 85.71% 0 Missing and 1 partial ⚠️
...n/InstanceGenericFirst/ServiceTypeRegistryCache.cs 87.50% 0 Missing and 1 partial ⚠️
src/Splat.Drawing/Colors/KnownColors.cs 87.50% 0 Missing and 1 partial ⚠️
...plat.Drawing/Platforms/Wpf/Bitmaps/BitmapMixins.cs 0.00% 1 Missing ⚠️
...at.Drawing/Platforms/Wpf/Colors/ColorExtensions.cs 0.00% 1 Missing ⚠️
...awing/Platforms/Wpf/Colors/SplatColorExtensions.cs 0.00% 1 Missing ⚠️
...lat.Drawing/Platforms/Wpf/Maths/PointExtensions.cs 0.00% 1 Missing ⚠️
...plat.Drawing/Platforms/Wpf/Maths/RectExtensions.cs 0.00% 1 Missing ⚠️
...plat.Drawing/Platforms/Wpf/Maths/SizeExtensions.cs 0.00% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1651       +/-   ##
===========================================
+ Coverage   82.25%   96.95%   +14.69%     
===========================================
  Files         122      124        +2     
  Lines        7018     6710      -308     
  Branches     1090     1008       -82     
===========================================
+ Hits         5773     6506      +733     
+ Misses        934      111      -823     
+ Partials      311       93      -218     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add behavioral tests exercising the lines introduced when fixing the analyzer
findings: the exception-observing catch blocks (throwing-disposable disposal and
throwing resolver-changed callbacks), the extra registration overloads that use
GetValueRefOrAddDefault, the IFormatProvider single-value logger overloads, the
service-collection unwrap loops, and the achromatic SplatColor paths. Each test
asserts real behavior.

The few remaining uncovered lines are genuinely-unreachable defensive/off-platform
code (nested catches whose inner guard always fires, BCL-guard catches with no
injection seam, and the WPF/Silverlight design-mode reflection that resolves only
on a real XAML host).
Copilot AI review requested due to automatic review settings July 23, 2026 10:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

Copilot reviewed 270 out of 271 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/Splat.Drawing/Platforms/ServiceLocationDrawingInitializationExtensions.cs:18

  • RegisterPlatformBitmapLoader no longer registers an IBitmapLoader implementation. As a result, consumers calling this API will not get the expected platform PlatformBitmapLoader registration, and BitmapLoader.Current may still throw BitmapLoaderException due to missing registration. The XML doc for this method also states it registers the platform loader, which is no longer true.

The net4 (.NET Framework) and net6 (net*-windows) platform folders both target
WPF (UseWPF is set for both TFM sets) and had byte-identical copies of the colour,
geometry and bitmap extension files. Move the seven shared files into a single
Platforms/Wpf/ folder compiled on both TFM sets, removing the duplication the
Sonar new-code gate flagged. BitmapSourceBitmap keeps its two versions (their
Save implementations genuinely differ).
…oc crefs

- RegisterPlatformBitmapLoader had been collapsed to an expression body (an
  SST2275 auto-fix on the modern targets, where the conditional body is empty),
  which dropped the actual IBitmapLoader registration on the WPF / .NET Framework
  targets. Restore the conditional registration and scope-suppress SST2275.
- Correct two XML doc crefs surfaced in review: the Rect FromNative summary said
  Point, and the Color FromNative summary said SolidColorBrush.
Add ~500 behavioral tests across the adapter, logger, resolver, drawing and
core projects so every reachable line and branch in the files this PR touched is
exercised (logger overload families, registration/resolution edge cases,
disposal and callback-failure paths, colour conversions, mode detection).

Where code is genuinely unreachable, extract the smallest wrapping method and
mark it [ExcludeFromCodeCoverage] (off-platform design-mode reflection, defensive
catches whose guarded call cannot throw, non-null field disposal). A few provably
dead branches are removed outright (a redundant null-conditional, a dead
already-immutable guard, an unreachable batch-eviction path).
Resolve(Type, string name, params) had an inverted TryGetValue check, so a
registered named type always returned null (and threw) and the CreateInstance
arm was dead. Match the sibling unnamed overload; add a success test and drop
the test that had pinned the buggy throw-when-registered behavior.
Replace the 12 duplicated exception-swallowing disposal/callback blocks across
ModernDependencyResolver, GlobalGenericFirstDependencyResolver and
InstanceGenericFirstDependencyResolver with a single
ResolverExceptionHelpers.RunSwallowingExceptions(Action) helper, and share the
GetValueRefOrAddDefault get-or-add via ResolverDictionaryHelpers.GetOrAddValue.
Removes the Sonar new-code duplication in the resolver family.
…tection

- Splat mode detection/TFM: extract pure matcher (NameContainsAnyMarker),
  add net11.0 target-framework moniker mapping, remove provably-dead
  AssemblyQualifiedName null guard, minimal ExcludeFromCodeCoverage on
  OS/permission-sensitive probe scaffolding, add tests.
- Splat.Core resolver family: remove dead ThrowIf-follow returns and
  null guards, scope copy-on-write / double-checked-lock race guards
  into minimal ExcludeFromCodeCoverage helpers.

Copy link
Copy Markdown

glennawatson merged commit 250c692 into main Jul 23, 2026
13 checks passed
glennawatson deleted the build/adopt-security-performance-analyzers branch July 23, 2026 22:15

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions Bot locked as resolved and limited conversation to collaborators Aug 7, 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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL