Closed johnml1135 closed 6 months ago
src/SIL.Machine.AspNetCore/Services/LanguageTagService.cs
line 41 at r1 (raw file):
The response is disposable, so you should use `using`.
Done.
src/SIL.Machine.AspNetCore/Services/LanguageTagService.cs
line 42 at r1 (raw file):
You should use the synchronous `Send` method here.
Done.
src/SIL.Machine.AspNetCore/Services/LanguageTagService.cs
line 46 at r1 (raw file):
You should use the synchronous `CopyTo` method here.
Done.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 67.22%. Comparing base (
448bd1e
) to head (96a6d81
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
src/SIL.Machine.AspNetCore/Services/LanguageTagService.cs
line 41 at r2 (raw file):
You shouldn't use `var` here.
Done.
src/SIL.Machine.AspNetCore/Services/LanguageTagService.cs
line 42 at r2 (raw file):
This doesn't seem correct. It should be something like this: ``` using HttpResponseMessage response = client.Send( new HttpRequestMessage( HttpMethod.Get, "https://raw.githubusercontent.com/silnrsi/langtags/master/pub/langtags.json" ) ); ```
Done.
src/SIL.Machine.AspNetCore/Services/LanguageTagService.cs
line 45 at r2 (raw file):
You can make this more concise, i.e. `using FileStream stream = new(cachedAllTagsPath, FileMode.Create);`
Done.
src/SIL.Machine.AspNetCore/Services/LanguageTagService.cs
line 53 at r4 (raw file):
You shouldn't call an asynchronous method from a synchronous method. You should use one of the synchronous methods in `HttpContent`.
Done.
tests/SIL.Machine.AspNetCore.Tests/Services/LanguageTagServiceTests.cs
line 37 at r4 (raw file):
Do we not need to call `Sldr.Initialize()` here as well?
Yes
src/SIL.Machine.AspNetCore/Services/LanguageTagService.cs
line 45 at r2 (raw file):
You still haven't done this yet. You can update both times you create `FileStream` to just use `new()`.
Done.
Serval was down because langtags.json was not available on
This change is