Skip to content

refactor: fix analyzer warnings (3) #2245

refactor: fix analyzer warnings (3)

refactor: fix analyzer warnings (3) #2245

Triggered via pull request January 12, 2025 18:47
Status Failure
Total duration 29m 31s
Artifacts 4

ci.yml

on: pull_request
Matrix: Unit tests
Mutation tests (Linux)
7m 21s
Mutation tests (Linux)
Mutation tests (Windows)
15m 7s
Mutation tests (Windows)
Static code analysis
13m 14s
Static code analysis
Publish Tests Results
22s
Publish Tests Results
Fit to window
Zoom out
Zoom in

Annotations

4 errors and 15 warnings
Static code analysis
[xUnit.net 00:00:04.20] Testably.Abstractions.Tests.TimeSystem.TimerTests.MockTimeSystemTests.Change_WithInt_ShouldResetTimer [FAIL]
Static code analysis
All 1 tries failed: System.AggregateException: One or more errors occurred. (Process 'dotnet' exited with code 1. > /usr/share/dotnet/dotnet test /home/runner/work/Testably.Abstractions/Testably.Abstractions/Tests/Testably.Abstractions.Tests/Testably.Abstractions.Tests.csproj --configuration Release --no-build --collect "XPlat Code Coverage" --results-directory /home/runner/work/Testably.Abstractions/Testably.Abstractions/TestResults --framework net7.0 --logger trx;LogFileName=Testably.Abstractions.Tests_net7.0.trx @ /home/runner/work/Testably.Abstractions/Testably.Abstractions Error output: [xUnit.net 00:00:04.20] Testably.Abstractions.Tests.TimeSystem.TimerTests.MockTimeSystemTests.Change_WithInt_ShouldResetTimer [FAIL] ) ---> Nuke.Common.Tooling.ProcessException: Process 'dotnet' exited with code 1. > /usr/share/dotnet/dotnet test /home/runner/work/Testably.Abstractions/Testably.Abstractions/Tests/Testably.Abstractions.Tests/Testably.Abstractions.Tests.csproj --configuration Release --no-build --collect "XPlat Code Coverage" --results-directory /home/runner/work/Testably.Abstractions/Testably.Abstractions/TestResults --framework net7.0 --logger trx;LogFileName=Testably.Abstractions.Tests_net7.0.trx @ /home/runner/work/Testably.Abstractions/Testably.Abstractions Error output: [xUnit.net 00:00:04.20] Testably.Abstractions.Tests.TimeSystem.TimerTests.MockTimeSystemTests.Change_WithInt_ShouldResetTimer [FAIL] at Nuke.Common.Tooling.ProcessExtensions.AssertZeroExitCode(IProcess process) in /_/source/Nuke.Tooling/ProcessExtensions.cs:line 38 at Nuke.Common.Tooling.ToolTasks.<>c.<GetExitHandler>b__4_0(ToolOptions _, IProcess p) in /_/source/Nuke.Tooling/ToolTasks.ExitHandler.cs:line 27 at Nuke.Common.Tooling.ToolTasks.<>c__DisplayClass8_0.<GetExitHandlerInternal>b__3(ToolOptions o, IProcess p) in /_/source/Nuke.Tooling/ToolTasks.ExitHandler.cs:line 22 at Nuke.Common.Tooling.ToolTasks.Run[T](ToolOptions options) in /_/source/Nuke.Tooling/ToolTasks.Run.cs:line 36 at Nuke.Common.Tools.DotNet.DotNetTasks.DotNetTest(DotNetTestSettings options) in /_/source/Nuke.Common/Tools/DotNet/DotNet.Generated.cs:line 32 at Nuke.Common.Tooling.ConfigureExtensions.<>c__DisplayClass1_0`1.<Invoke>b__0(TOptions x) in /_/source/Nuke.Tooling/Configure.cs:line 38 at Nuke.Common.Tooling.ConfigureExtensions.<>c__DisplayClass3_0`2.<Invoke>b__0(TOptions x) in /_/source/Nuke.Tooling/Configure.cs:line 78 --- End of inner exception stack trace --- at Nuke.Common.Tooling.ConfigureExtensions.Invoke[TOptions,TResult](CombinatorialConfigure`1 configurator, Func`2 executor, Func`2 outputSelector, Int32 degreeOfParallelism, Boolean completeOnFailure) in /_/source/Nuke.Tooling/Configure.cs:line 91 at Nuke.Common.Tooling.ConfigureExtensions.Invoke[TOptions](CombinatorialConfigure`1 configurator, Func`2 executor, Int32 degreeOfParallelism, Boolean completeOnFailure) at Nuke.Common.Tools.DotNet.DotNetTasks.DotNetTest(CombinatorialConfigure`1 configurator, Int32 degreeOfParallelism, Boolean completeOnFailure) in /_/source/Nuke.Common/Tools/DotNet/DotNet.Generated.cs:line 36 at Build.Build.<get_DotNetUnitTests>b__57_1() in /home/runner/work/Testably.Abstractions/Testably.Abstractions/Pipeline/Build.UnitTest.cs:line 70
Static code analysis
Target "DotNetUnitTests" has thrown an exception
Static code analysis
Process completed with exit code 255.
API tests
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Mutation tests (Linux)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Unit tests (ubuntu-latest)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Static code analysis
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
Static code analysis
/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Storage/InMemoryStorage.cs(51,27): warning S3776: Refactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776) [/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Testably.Abstractions.Testing.csproj::TargetFramework=net7.0]
Static code analysis
/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Storage/InMemoryStorage.cs(179,39): warning S3776: Refactor this method to reduce its Cognitive Complexity from 24 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776) [/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Testably.Abstractions.Testing.csproj::TargetFramework=net7.0]
Static code analysis
/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Storage/InMemoryStorage.cs(600,7): warning S2583: Change this condition so that it does not always evaluate to 'False'. Some code paths are unreachable. (https://rules.sonarsource.com/csharp/RSPEC-2583) [/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Testably.Abstractions.Testing.csproj::TargetFramework=net7.0]
Static code analysis
/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Storage/InMemoryStorage.cs(430,27): warning S3776: Refactor this method to reduce its Cognitive Complexity from 26 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776) [/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Testably.Abstractions.Testing.csproj::TargetFramework=net7.0]
Static code analysis
/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Storage/InMemoryStorage.cs(925,26): warning S2589: Change this condition so that it does not always evaluate to 'True'. (https://rules.sonarsource.com/csharp/RSPEC-2589) [/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Testably.Abstractions.Testing.csproj::TargetFramework=net7.0]
Static code analysis
/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Storage/InMemoryStorage.cs(891,28): warning S3776: Refactor this method to reduce its Cognitive Complexity from 28 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776) [/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Testably.Abstractions.Testing.csproj::TargetFramework=net7.0]
Static code analysis
/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Storage/InMemoryStorage.cs(964,13): warning S2234: Parameters to 'MoveInternal' have the same names but not the same order as the method arguments. (https://rules.sonarsource.com/csharp/RSPEC-2234) [/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Testably.Abstractions.Testing.csproj::TargetFramework=net7.0]
Static code analysis
/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Helpers/ExceptionFactory.cs(61,7): warning S3358: Extract this nested ternary operation into an independent statement. (https://rules.sonarsource.com/csharp/RSPEC-3358) [/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Testably.Abstractions.Testing.csproj::TargetFramework=net7.0]
Static code analysis
/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Helpers/ExceptionFactory.cs(61,7): warning S3358: Extract this nested ternary operation into an independent statement. (https://rules.sonarsource.com/csharp/RSPEC-3358) [/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Testably.Abstractions.Testing.csproj::TargetFramework=net8.0]
Static code analysis
/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Storage/InMemoryStorage.cs(51,27): warning S3776: Refactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776) [/home/runner/work/Testably.Abstractions/Testably.Abstractions/Source/Testably.Abstractions.Testing/Testably.Abstractions.Testing.csproj::TargetFramework=net8.0]
Publish Tests Results
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636

Artifacts

Produced during runtime
Name Size
API-tests
4.23 KB
Linux-artifacts
8.12 MB
Windows-artifacts
8.15 MB
macOS-artifacts
8.09 MB