Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/UnfoldedCircle.AdbTv/AdbTv/AdbTvClientFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
private static readonly TimeSpan CacheDuration = TimeSpan.FromMinutes(1);
private static readonly TimeSpan HealthyDeviceTimeout = TimeSpan.FromSeconds(5);

public async ValueTask<DeviceClient?> TryGetOrCreateClientAsync(AdbTvClientKey adbTvClientKey, CancellationToken cancellationToken)

Check warning on line 25 in src/UnfoldedCircle.AdbTv/AdbTv/AdbTvClientFactory.cs

View workflow job for this annotation

GitHub Actions / Build and analyze

Refactor this method to reduce its Cognitive Complexity from 21 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776)

Check warning on line 25 in src/UnfoldedCircle.AdbTv/AdbTv/AdbTvClientFactory.cs

View workflow job for this annotation

GitHub Actions / Build and analyze

Refactor this method to reduce its Cognitive Complexity from 21 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776)
{
try
{
Expand Down Expand Up @@ -83,8 +83,8 @@
{
var deviceData = (await adbClient.GetDevicesAsync(cancellationToken)).FirstOrDefault(x =>
x.Serial.Equals(serial, StringComparison.InvariantCulture));
deviceClient = deviceData.CreateDeviceClient();
if (deviceClient.Device.State == DeviceState.Online || !RetryStates.Contains(deviceClient.Device.State))
deviceClient = deviceData?.CreateDeviceClient();
if (deviceClient is { Device.State: DeviceState.Online } || deviceClient is not null && !RetryStates.Contains(deviceClient.Device.State))
break;

await Task.Delay(100, cancellationToken);
Expand Down
2 changes: 1 addition & 1 deletion src/UnfoldedCircle.AdbTv/UnfoldedCircle.AdbTv.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AdvancedSharpAdbClient" Version="3.4.14" />
<PackageReference Include="AdvancedSharpAdbClient" Version="3.5.15" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.257">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Loading