Skip to content

Upgrade to .NET 10.0 and update dependencies across the solution; ref…#37

Merged
HowardvanRooijen merged 3 commits intomainfrom
features/dotnet-10-update
Mar 27, 2026
Merged

Upgrade to .NET 10.0 and update dependencies across the solution; ref…#37
HowardvanRooijen merged 3 commits intomainfrom
features/dotnet-10-update

Conversation

@HowardvanRooijen
Copy link
Copy Markdown
Member

…actor integration tests and CLI commands to accommodate framework changes; remove obsolete solution file; enhance README with updated usage instructions for .NET 10.0.

…actor integration tests and CLI commands to accommodate framework changes; remove obsolete solution file; enhance README with updated usage instructions for .NET 10.0.
Copilot AI review requested due to automatic review settings March 27, 2026 08:09
@HowardvanRooijen
Copy link
Copy Markdown
Member Author

Also addresses #36

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 27, 2026

Test Results

214 tests  +13   209 ✅ +13   51s ⏱️ +24s
  1 suites ± 0     5 💤 ± 0 
  1 files   ± 0     0 ❌ ± 0 

Results for commit 460777e. ± Comparison against base commit 21586b5.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the DeadCode solution to .NET 10, refreshes key NuGet dependencies (notably Spectre.Console + CLI/test libs), and updates build/test tooling and documentation to match the new target framework and solution layout.

Changes:

  • Migrate projects and docs from net9.0 to net10.0, and update CI to use the .NET 10 SDK.
  • Update Spectre.Console(-Cli) usage, including command execution signatures and DI wiring via the custom TypeRegistrar.
  • Replace the legacy .sln with a .slnx and align build configuration/scripts accordingly.

Reviewed changes

Copilot reviewed 27 out of 29 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
build.ps1 Keeps the PowerShell build entrypoint aligned with updated repo formatting/tooling.
.zf/config.ps1 Switches build configuration to use Solutions/DeadCode.slnx.
.github/workflows/build.yml Updates CI to run with .NET SDK 10.x.
Solutions/DeadCode.slnx Adds the new XML-based solution definition.
Solutions/DeadCode.sln Removes the legacy Visual Studio solution file.
Solutions/demo.ps1 Updates demo script paths to net10.0 outputs.
Solutions/DeadCode/DeadCode.csproj Moves tool to net10.0 and bumps runtime dependencies.
Solutions/DeadCode/Program.cs Adjusts Spectre.Console.Cli DI integration (defer BuildServiceProvider).
Solutions/DeadCode/CLI/Commands/ExtractCommand.cs Updates command execution signature to include cancellation.
Solutions/DeadCode/CLI/Commands/ProfileCommand.cs Updates command execution signature to include cancellation.
Solutions/DeadCode/CLI/Commands/AnalyzeCommand.cs Updates command execution signature to include cancellation.
Solutions/DeadCode/CLI/Commands/FullCommand.cs Updates command execution signature and forwards cancellation to subcommands.
Solutions/DeadCode/README.md Updates usage examples and requirements to .NET 10 / net10.0.
README.md Updates root documentation examples/requirements to .NET 10 / net10.0.
Solutions/Samples/SampleAppWithDeadCode/SampleAppWithDeadCode.csproj Moves sample app to net10.0.
Solutions/DeadCode.Tests/DeadCode.Tests.csproj Moves tests to net10.0 and bumps test/dependency packages.
Solutions/DeadCode.Tests/TestFixtures/SampleConsoleApp/SampleConsoleApp.csproj Moves fixture app to net10.0.
Solutions/DeadCode.Tests/TestFixtures/SampleAsyncApp/SampleAsyncApp.csproj Moves fixture app to net10.0.
Solutions/DeadCode.Tests/TestFixtures/SampleInheritanceApp/SampleInheritanceApp.csproj Moves fixture app to net10.0.
Solutions/DeadCode.Tests/Integration/ReflectionMethodScannerIntegrationTests.cs Updates fixture assembly paths to net10.0.
Solutions/DeadCode.Tests/Integration/DeadCodeDetectionIntegrationTests.cs Updates sample app path to net10.0.
Solutions/DeadCode.Tests/Integration/ProgramIntegrationTests.cs Updates TypeRegistrar test to match new ctor signature.
Solutions/DeadCode.Tests/CLI/Infrastructure/TypeRegistrarTests.cs Updates tests to match new TypeRegistrar behavior and adds resolvability assertions.
Solutions/DeadCode.Tests/CLI/Commands/ProfileCommandTests.cs Updates test calls to include CancellationToken.
Solutions/DeadCode.Tests/CLI/Commands/FullCommandTests.cs Updates mocks/calls to include CancellationToken.
Solutions/DeadCode.Tests/CLI/Commands/ExtractCommandTests.cs Updates test calls to include CancellationToken.
Solutions/DeadCode.Tests/CLI/Commands/AnalyzeCommandTests.cs Updates test calls to include CancellationToken.
.gitignore Adds ignores for additional local/dev directories.
.gitattributes Introduces line-ending normalization rules across the repo.

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

Comment on lines +80 to 82
public override async Task<int> ExecuteAsync(CommandContext context, Settings settings, CancellationToken cancellation)
{
logger.LogInformation("Starting profiling session");
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

CancellationToken cancellation is currently ignored. Profiling scenarios and trace collection can take a long time, so the command should observe cancellation (e.g., check cancellation.ThrowIfCancellationRequested() between scenarios) and pass it to cancellable I/O like File.ReadAllTextAsync when loading scenarios.

Copilot uses AI. Check for mistakes.
Comment on lines +84 to 86
public override async Task<int> ExecuteAsync(CommandContext context, Settings settings, CancellationToken cancellation)
{
logger.LogInformation("Starting redundancy analysis");
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

The added CancellationToken cancellation parameter isn’t used, so trace parsing/analysis can’t be cancelled once started. Consider threading cancellation through file reads (e.g., File.ReadAllTextAsync) and checking it inside the trace parsing loop to abort promptly.

Copilot uses AI. Check for mistakes.
Comment on lines +83 to 86
public override async Task<int> ExecuteAsync(CommandContext context, Settings settings, CancellationToken cancellation)
{
logger.LogInformation("Starting full deadcode analysis pipeline");

Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

CancellationToken cancellation is forwarded to sub-commands, but this method doesn’t check it between steps. Consider calling cancellation.ThrowIfCancellationRequested() before/after each pipeline stage so a cancel request doesn’t continue executing subsequent steps.

Copilot uses AI. Check for mistakes.
Comment on lines +56 to 57
public override async Task<int> ExecuteAsync(CommandContext context, Settings settings, CancellationToken cancellation)
{
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

The new CancellationToken cancellation parameter isn’t used, so cancellation (e.g., Ctrl+C) won’t stop long-running extraction or the file write. Consider passing cancellation into cancellable operations (e.g., File.WriteAllTextAsync) and checking/throwing cancellation inside the progress loop so the command can abort promptly.

Copilot uses AI. Check for mistakes.
…ntory and RedundancyReport to use cached methods; enhance JSON serialization options; remove obsolete test helpers and project settings for .NET 10.0
…nds; update inventory loading and saving methods to accept CancellationToken
@github-actions
Copy link
Copy Markdown

Code Coverage Summary Report - Linux (No TFM)

Summary
Generated on: 03/27/2026 - 09:04:58
Parser: Cobertura
Assemblies: 2
Classes: 68
Files: 45
Line coverage: 89.9% (3772 of 4195)
Covered lines: 3772
Uncovered lines: 423
Coverable lines: 4195
Total lines: 8271
Branch coverage: 65.1% (418 of 642)
Covered branches: 418
Total branches: 642
Method coverage: Feature is only available for sponsors

Coverage

DeadCode - 78.7%
Name Line Branch
DeadCode 78.7% 61.6%
DeadCode.CLI.Commands.AnalyzeCommand 97.4% 66.6%
DeadCode.CLI.Commands.AnalyzeCommand.Settings 100% 100%
DeadCode.CLI.Commands.ExtractCommand 90.1% 35%
DeadCode.CLI.Commands.ExtractCommand.Settings 100% 100%
DeadCode.CLI.Commands.FullCommand 100% 92.8%
DeadCode.CLI.Commands.FullCommand.Settings 100% 100%
DeadCode.CLI.Commands.ProfileCommand 99.2% 87.5%
DeadCode.CLI.Commands.ProfileCommand.Settings 100% 100%
DeadCode.CLI.Commands.ProfilingScenario 100%
DeadCode.CLI.Commands.ScenariosConfiguration 100%
DeadCode.Core.Models.MethodInfo 100%
DeadCode.Core.Models.MethodInventory 100% 90%
DeadCode.Core.Models.RedundancyReport 100% 100%
DeadCode.Core.Models.ReportStatistics 100%
DeadCode.Core.Models.SourceLocation 100%
DeadCode.Core.Models.TraceResult 100%
DeadCode.Core.Models.UnusedMethod 100% 100%
DeadCode.Core.Services.ExtractionProgress 100%
DeadCode.Infrastructure.IO.ComparisonEngine 100% 100%
DeadCode.Infrastructure.IO.JsonOptions 100%
DeadCode.Infrastructure.IO.JsonReportGenerator 100% 100%
DeadCode.Infrastructure.Profiling.DotnetTraceRunner 57.8% 13.6%
DeadCode.Infrastructure.Profiling.DotnetTraceVerifier 82.1% 50%
DeadCode.Infrastructure.Profiling.SignatureNormalizer 0% 0%
DeadCode.Infrastructure.Profiling.TraceParser 27% 25.5%
DeadCode.Infrastructure.Reflection.PdbReader 95% 100%
DeadCode.Infrastructure.Reflection.ReflectionMethodExtractor 63.9% 56.9%
DeadCode.Infrastructure.Reflection.RuleBasedSafetyClassifier 95.3% 81.6%
Program 97.8% 100%
TypeRegistrar 100%
TypeResolver 100% 100%
DeadCode.Tests - 95.7%
Name Line Branch
DeadCode.Tests 95.7% 73.8%
DeadCode.Tests.CLI.Commands.AnalyzeCommandTests 100%
DeadCode.Tests.CLI.Commands.ExtractCommandTests 100% 87.5%
DeadCode.Tests.CLI.Commands.FullCommandTests 100% 100%
DeadCode.Tests.CLI.Commands.ProfileCommandTests 100%
DeadCode.Tests.CLI.Infrastructure.TypeRegistrarTests 100% 100%
DeadCode.Tests.CLI.Infrastructure.TypeResolverTests 100% 100%
DeadCode.Tests.Core.Models.MethodInfoTests 100%
DeadCode.Tests.Core.Models.MethodInventoryTests 100% 100%
DeadCode.Tests.Core.Models.RedundancyReportTests 100% 100%
DeadCode.Tests.Core.Models.SourceLocationTests 100%
DeadCode.Tests.Core.Models.TraceResultTests 100%
DeadCode.Tests.Core.Models.UnusedMethodTests 100%
DeadCode.Tests.Core.Services.ExtractionOptionsTests 100%
DeadCode.Tests.Infrastructure.IO.ComparisonEngineTests 100%
DeadCode.Tests.Infrastructure.IO.JsonReportGeneratorTests 100% 100%
DeadCode.Tests.Infrastructure.Profiling.DotnetTraceRunnerTests 98.9% 71.4%
DeadCode.Tests.Infrastructure.Profiling.DotnetTraceVerifierTests 100% 100%
DeadCode.Tests.Infrastructure.Profiling.TraceParserTests 100% 100%
DeadCode.Tests.Infrastructure.Reflection.PdbReaderTests 93.6% 56.2%
DeadCode.Tests.Infrastructure.Reflection.ReflectionMethodExtractorTests 78.8% 83.3%
DeadCode.Tests.Infrastructure.Reflection.ReflectionMethodExtractorTests.Con
structorTestClass
0%
DeadCode.Tests.Infrastructure.Reflection.ReflectionMethodExtractorTests.Gen
ericTestClass
0%
DeadCode.Tests.Infrastructure.Reflection.ReflectionMethodExtractorTests.Out
erClass
0%
DeadCode.Tests.Infrastructure.Reflection.ReflectionMethodExtractorTests.Out
erClass.NestedClass
0%
DeadCode.Tests.Infrastructure.Reflection.ReflectionMethodExtractorTests.Sig
natureTestClass
0%
DeadCode.Tests.Infrastructure.Reflection.ReflectionMethodExtractorTests.Tes
tClassWithLambda
0% 0%
DeadCode.Tests.Infrastructure.Reflection.ReflectionMethodExtractorTests.Vis
ibilityTestClass
0%
DeadCode.Tests.Infrastructure.Reflection.RuleBasedSafetyClassifierTests 82%
DeadCode.Tests.Infrastructure.Reflection.RuleBasedSafetyClassifierTests.Ser
ializableTestClass
0%
DeadCode.Tests.Infrastructure.Reflection.RuleBasedSafetyClassifierTests.Tes
tClassWithEventHandler
0%
DeadCode.Tests.Infrastructure.Reflection.RuleBasedSafetyClassifierTests.Tes
tClassWithProperty
0%
DeadCode.Tests.Infrastructure.Reflection.RuleBasedSafetyClassifierTests.Tes
tClassWithVisibility
0%
DeadCode.Tests.Infrastructure.Reflection.RuleBasedSafetyClassifierTests.Tes
tMethodClass
0%
DeadCode.Tests.Integration.DeadCodeDetectionIntegrationTests 99.1% 83.3%
DeadCode.Tests.Integration.DeadCodeDetectionSimpleTests 100% 100%
DeadCode.Tests.Integration.ProgramIntegrationTests 100%
DeadCode.Tests.Integration.ReflectionMethodScannerIntegrationTests 37.6% 21.8%

@HowardvanRooijen HowardvanRooijen merged commit 991b712 into main Mar 27, 2026
6 checks passed
@HowardvanRooijen HowardvanRooijen deleted the features/dotnet-10-update branch March 27, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants