< Summary - Estud

Information
Class: Estud.Back.Domain.Webhooks.WebhookCustomHeaders
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Domain/Webhooks/WebhookCustomHeaders.cs
Tag: 114_29044117136
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 23
Line coverage: 100%
Branch coverage
71%
Covered branches: 10
Total branches: 14
Branch coverage: 71.4%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
IsValid(...)71.42%1414100%

File(s)

/home/runner/work/syki/syki/Back/Domain/Webhooks/WebhookCustomHeaders.cs

#LineLine coverage
 1namespace Estud.Back.Domain.Webhooks;
 2
 3public static class WebhookCustomHeaders
 4{
 5    public const int MaxHeaders = 20;
 6    public const int MaxKeyLength = 100;
 7    public const int MaxValueLength = 1000;
 8
 9    public static bool IsValid(Dictionary<string, string> headers)
 10    {
 5211        if (headers == null) return true;
 12
 5213        if (headers.Count > MaxHeaders) return false;
 14
 12815        foreach (var (key, value) in headers)
 16        {
 1417            if (key.IsEmpty() || key.Length > MaxKeyLength) return false;
 1818            if (value.IsEmpty() || value.Length > MaxValueLength) return false;
 19        }
 20
 4821        return true;
 422    }
 23}