Skip to content

fix: resolve all compilation warnings for clean build#163

Merged
tylerkron merged 1 commit intomainfrom
fix/resolve-compilation-warnings
Apr 4, 2026
Merged

fix: resolve all compilation warnings for clean build#163
tylerkron merged 1 commit intomainfrom
fix/resolve-compilation-warnings

Conversation

@tylerkron
Copy link
Copy Markdown
Contributor

Summary

  • Fixes all 21 unique compilation warning locations (42 total across net8.0/net9.0 TFMs) to achieve a zero-warning build
  • Production code: fixed CA2022 inexact Stream.Read in StreamMessageConsumer and made DeviceTypeDetector.DetectFromPartNumber accept nullable string to match its actual contract
  • Test code: converted async voidasync Task, Task.WaitAllawait Task.WhenAll, added nullable annotations, and used Assert.Single predicate overload

Test plan

  • dotnet build produces 0 warnings, 0 errors
  • All 820 tests pass on both net8.0 and net9.0

🤖 Generated with Claude Code

- CA2022: explicitly discard Stream.Read return value in buffer drain loop
- CS8600/CS8602: add nullable annotations for null assignments and dereferences
- xUnit1031: convert blocking Task.WaitAll to async Task.WhenAll in tests
- xUnit1048: convert async void test methods to async Task
- xUnit2031: use Assert.Single predicate overload instead of Where+Single
- xUnit1012: make DeviceTypeDetector.DetectFromPartNumber accept nullable string

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tylerkron tylerkron requested a review from a team as a code owner April 4, 2026 05:06
@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Resolve all 21 compilation warnings for clean zero-warning build

🐞 Bug fix 🧪 Tests

Grey Divider

Walkthroughs

Description
• Resolved 21 unique compilation warnings across net8.0/net9.0 TFMs
• Converted blocking Task.WaitAll to async await Task.WhenAll in tests
• Changed async void test methods to async Task for proper async handling
• Added nullable annotations (?) for null assignments and dereferences
• Fixed CA2022 warning by explicitly discarding Stream.Read return value
• Updated DeviceTypeDetector.DetectFromPartNumber to accept nullable string
• Used Assert.Single predicate overload instead of Where+Single pattern
Diagram
flowchart LR
  A["Compilation Warnings<br/>21 unique locations"] -->|"CA2022: Stream.Read"| B["StreamMessageConsumer<br/>Discard return value"]
  A -->|"CS8600/CS8602: Nullability"| C["Add nullable annotations<br/>string? parameters"]
  A -->|"xUnit violations"| D["Test code fixes"]
  D -->|"xUnit1048: async void"| E["Convert to async Task"]
  D -->|"xUnit1031: blocking"| F["Task.WaitAll → Task.WhenAll"]
  D -->|"xUnit2031: LINQ"| G["Assert.Single predicate"]
  C -->|"DeviceTypeDetector"| H["Accept nullable string"]
  B --> I["Zero-warning build<br/>net8.0 & net9.0"]
  E --> I
  F --> I
  G --> I
  H --> I
Loading

Grey Divider

File Changes

1. src/Daqifi.Core.Tests/Channel/AnalogChannelTests.cs 🧪 Tests +2/-2

Convert blocking test to async Task

src/Daqifi.Core.Tests/Channel/AnalogChannelTests.cs


2. src/Daqifi.Core.Tests/Channel/DigitalChannelTests.cs 🧪 Tests +2/-2

Convert blocking test to async Task

src/Daqifi.Core.Tests/Channel/DigitalChannelTests.cs


3. src/Daqifi.Core.Tests/Communication/Transport/UdpTransportTests.cs 🧪 Tests +5/-4

Convert async void tests and blocking calls

src/Daqifi.Core.Tests/Communication/Transport/UdpTransportTests.cs


View more (7)
4. src/Daqifi.Core.Tests/Device/DeviceTypeDetectorTests.cs 🧪 Tests +1/-1

Add nullable annotation to test parameter

src/Daqifi.Core.Tests/Device/DeviceTypeDetectorTests.cs


5. src/Daqifi.Core.Tests/Device/Protocol/ProtobufProtocolHandlerTests.cs 🧪 Tests +6/-6

Convert async void to Task and add nullability

src/Daqifi.Core.Tests/Device/Protocol/ProtobufProtocolHandlerTests.cs


6. src/Daqifi.Core.Tests/Device/SdCard/SdCardCsvFileParserTests.cs 🧪 Tests +8/-7

Add null-forgiving operators and nullable initialization

src/Daqifi.Core.Tests/Device/SdCard/SdCardCsvFileParserTests.cs


7. src/Daqifi.Core.Tests/Device/SdCard/SdCardJsonFileParserTests.cs 🧪 Tests +3/-2

Add null-forgiving operators and nullable initialization

src/Daqifi.Core.Tests/Device/SdCard/SdCardJsonFileParserTests.cs


8. src/Daqifi.Core.Tests/Device/TimestampProcessorTests.cs 🧪 Tests +5/-5

Convert blocking tests and use Assert.Single predicate

src/Daqifi.Core.Tests/Device/TimestampProcessorTests.cs


9. src/Daqifi.Core/Communication/Consumers/StreamMessageConsumer.cs 🐞 Bug fix +1/-1

Explicitly discard Stream.Read return value

src/Daqifi.Core/Communication/Consumers/StreamMessageConsumer.cs


10. src/Daqifi.Core/Device/DeviceTypeDetector.cs 🐞 Bug fix +1/-1

Accept nullable string parameter

src/Daqifi.Core/Device/DeviceTypeDetector.cs


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review bot commented Apr 4, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@tylerkron tylerkron merged commit e8d84af into main Apr 4, 2026
1 check passed
@tylerkron tylerkron deleted the fix/resolve-compilation-warnings branch April 4, 2026 05:10
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.

1 participant