Apply fixes from CodeFactor - #32
Conversation
| while ((bytesRead = await contentStream | ||
| .ReadAsync(buffer, 0, buffer.Length, cancellationToken) | ||
| .ReadAsync(buffer, cancellationToken) | ||
| .ConfigureAwait(false)) != 0) |
There was a problem hiding this comment.
The CodeFactor bot placed
.ReadAsync(buffer, cancellationToken) at column 0, breaking the indentation of the method chain. The call should be indented to align with the surrounding code.
| while ((bytesRead = await contentStream | |
| .ReadAsync(buffer, 0, buffer.Length, cancellationToken) | |
| .ReadAsync(buffer, cancellationToken) | |
| .ConfigureAwait(false)) != 0) | |
| while ((bytesRead = await contentStream | |
| .ReadAsync(buffer, cancellationToken) | |
| .ConfigureAwait(false)) != 0) |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/Trackdub.Infrastructure/Licensing/ModelDownloaderAdapter.cs
Line: 198-200
Comment:
The CodeFactor bot placed `.ReadAsync(buffer, cancellationToken)` at column 0, breaking the indentation of the method chain. The call should be indented to align with the surrounding code.
```suggestion
while ((bytesRead = await contentStream
.ReadAsync(buffer, cancellationToken)
.ConfigureAwait(false)) != 0)
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| while ((bytesRead = await contentStream | ||
| .ReadAsync(buffer, 0, buffer.Length, cancellationToken) | ||
| .ReadAsync(buffer, cancellationToken) | ||
| .ConfigureAwait(false)) != 0) |
There was a problem hiding this comment.
Same column-0 indentation defect introduced by the bot —
.ReadAsync(buffer, cancellationToken) should be indented to align with the method chain.
| while ((bytesRead = await contentStream | |
| .ReadAsync(buffer, 0, buffer.Length, cancellationToken) | |
| .ReadAsync(buffer, cancellationToken) | |
| .ConfigureAwait(false)) != 0) | |
| while ((bytesRead = await contentStream | |
| .ReadAsync(buffer, cancellationToken) | |
| .ConfigureAwait(false)) != 0) |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/Trackdub.Infrastructure/Updates/UpdateService.cs
Line: 299-301
Comment:
Same column-0 indentation defect introduced by the bot — `.ReadAsync(buffer, cancellationToken)` should be indented to align with the method chain.
```suggestion
while ((bytesRead = await contentStream
.ReadAsync(buffer, cancellationToken)
.ConfigureAwait(false)) != 0)
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Closing as superseded.
CI on this PR also failed because |
This pull request applies fixes from code review by CodeFactor.
For more information, click here.
Summary by cubic
Use modern Stream.ReadAsync overloads with CancellationToken and Memory across the downloaders, update service, and the PCM16 WAV extractor. This simplifies the code, aligns with CodeFactor recommendations, and keeps behavior the same.
Written for commit de68e6d. Summary will update on new commits.
Confidence Score: 4/5
Safe to merge — the API migration is functionally equivalent in all four files; the only issues are two indentation defects introduced by the bot.
The ReadAsync migration is correct throughout the PR and carries no behavioral risk. The two broken-indentation lines in ModelDownloaderAdapter.cs and UpdateService.cs are a cosmetic artifact of the automated bot and do not affect compilation or runtime behavior, but they leave the codebase with visibly malformed method chains that would confuse future readers.
Files Needing Attention: ModelDownloaderAdapter.cs and UpdateService.cs — both have the column-0 indentation defect on the newly changed ReadAsync call.
Important Files Changed
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "[CodeFactor] Apply fixes" | Re-trigger Greptile