< Summary

Information
Class: Elsa.Http.Extensions.HttpStatusCodeExtensions
Assembly: Elsa.Http
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Http/Extensions/HttpStatusCodeExtensions.cs
Line coverage
54%
Covered lines: 6
Uncovered lines: 5
Coverable lines: 11
Total lines: 21
Line coverage: 54.5%
Branch coverage
64%
Covered branches: 9
Total branches: 14
Branch coverage: 64.2%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
IsTransientStatusCode(...)64.28%321454.54%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Http/Extensions/HttpStatusCodeExtensions.cs

#LineLine coverage
 1using System.Net;
 2
 3namespace Elsa.Http.Extensions;
 4
 5public static class HttpStatusCodeExtensions
 6{
 7    public static bool IsTransientStatusCode(this HttpStatusCode statusCode)
 8    {
 39        return statusCode switch
 310        {
 011            HttpStatusCode.RequestTimeout => true,
 112            HttpStatusCode.TooManyRequests => true,
 013            HttpStatusCode.InternalServerError => true,
 014            HttpStatusCode.BadGateway => true,
 115            HttpStatusCode.ServiceUnavailable => true,
 016            HttpStatusCode.GatewayTimeout => true,
 017            HttpStatusCode.Conflict => true,
 118            _ => false
 319        };
 20    }
 21}