< Summary

Information
Class: ProjectTemplate.Web.Options.ApplicationRateLimitingOptions
Assembly: ProjectTemplate.Web
File(s): /home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/src/ProjectTemplate.Web/Options/ApplicationRateLimitingOptions.cs
Line coverage
100%
Covered lines: 19
Uncovered lines: 0
Coverable lines: 19
Total lines: 52
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Enabled()100%11100%
get_UseGlobalLimiter()100%11100%
get_GlobalFixedWindow()100%11100%
.ctor()100%11100%
get_FixedWindowPolicy()100%11100%
get_ConcurrencyPolicy()100%11100%

File(s)

/home/runner/work/NetCoreApplicationTemplate/NetCoreApplicationTemplate/src/ProjectTemplate.Web/Options/ApplicationRateLimitingOptions.cs

#LineLine coverage
 1namespace ProjectTemplate.Web.Options;
 2
 3/// <summary>
 4/// Represents template-level rate limiting configuration.
 5/// </summary>
 6public sealed class ApplicationRateLimitingOptions
 7{
 8    /// <summary>
 9    /// Configuration section name for rate limiting settings.
 10    /// </summary>
 11    public const string SectionName = "ProjectTemplate:RateLimiting";
 12
 13    /// <summary>
 14    /// Gets or sets a value indicating whether rate limiting is enabled.
 15    /// </summary>
 142816    public bool Enabled { get; set; } = true;
 17
 18    /// <summary>
 19    /// Gets or sets a value indicating whether to use the global limiter.
 20    /// When true, <see cref="GlobalFixedWindow"/> is used as a global limiter.
 21    /// </summary>
 143222    public bool UseGlobalLimiter { get; set; } = true;
 23
 24    /// <summary>
 25    /// Gets or sets the global fixed-window rate limiting options.
 26    /// </summary>
 347227    public FixedWindowRateLimitingOptions GlobalFixedWindow { get; set; } = new()
 52028    {
 52029        PermitLimit = 60,
 52030        WindowSeconds = 60,
 52031        QueueLimit = 0
 52032    };
 33
 34    /// <summary>
 35    /// Gets or sets the fixed-window rate limiting options applied at the template level.
 36    /// </summary>
 338837    public FixedWindowRateLimitingOptions FixedWindowPolicy { get; set; } = new()
 52038    {
 52039        PermitLimit = 60,
 52040        WindowSeconds = 60,
 52041        QueueLimit = 0
 52042    };
 43
 44    /// <summary>
 45    /// Gets or sets the concurrency-based rate limiting options applied at the template level.
 46    /// </summary>
 260647    public ConcurrencyRateLimitingOptions ConcurrencyPolicy { get; set; } = new()
 52048    {
 52049        PermitLimit = 10,
 52050        QueueLimit = 0
 52051    };
 52}