< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Hosting.Options.KestrunOptions
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/Options/KestrunOptions.cs
Tag: Kestrun/Kestrun@2d87023b37eb91155071c91dd3d6a2eeb3004705
Line coverage
100%
Covered lines: 21
Uncovered lines: 0
Coverable lines: 21
Total lines: 88
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

Coverage history

Coverage history 0 25 50 75 100 08/26/2025 - 01:25:22 Line coverage: 92.3% (12/13) Total lines: 59 Tag: Kestrun/Kestrun@07f821172e5dc3657f1be7e6818f18d6721cf38a09/08/2025 - 16:52:37 Line coverage: 88.8% (16/18) Total lines: 80 Tag: Kestrun/Kestrun@14183915904bc10657c407aa6953ae9be314429f09/08/2025 - 20:34:03 Line coverage: 94.7% (18/19) Total lines: 81 Tag: Kestrun/Kestrun@3790ee5884494a7a2a829344a47743e0bf492e7210/13/2025 - 16:52:37 Line coverage: 100% (21/21) Total lines: 88 Tag: Kestrun/Kestrun@10d476bee71c71ad215bb8ab59f219887b5b4a5e

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_ServerOptions()100%11100%
get_ServerLimits()100%11100%
get_ApplicationName()100%11100%
get_MaxRunspaces()100%11100%
get_MinRunspaces()100%11100%
get_MaxSchedulerRunspaces()100%11100%
get_Health()100%11100%
get_Listeners()100%11100%
get_HttpsConnectionAdapter()100%11100%
get_ListenUnixSockets()100%11100%
get_NamedPipeNames()100%11100%
get_NamedPipeOptions()100%11100%
.ctor()100%11100%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/Options/KestrunOptions.cs

#LineLine coverage
 1using Microsoft.AspNetCore.Server.Kestrel.Core;
 2using Microsoft.AspNetCore.Server.Kestrel.Https;
 3using Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes;
 4using Kestrun.Health;
 5namespace Kestrun.Hosting.Options;
 6
 7/// <summary>
 8/// Simple options class for configuring Kestrel server settings.
 9/// </summary>
 10/// <remarks>
 11/// This class provides a strongly-typed alternative to using a hashtable for Kestrel server options.
 12/// </remarks>
 13public class KestrunOptions
 14{
 15    /// <summary>
 16    /// Gets or sets the Kestrel server options.
 17    /// </summary>
 71418    public KestrelServerOptions ServerOptions { get; set; }
 19
 20    /// <summary>Provides access to request limit options. Use a hashtable or a KestrelServerLimits instance.</summary>
 221    public KestrelServerLimits ServerLimits => ServerOptions.Limits;
 22
 23    /// <summary>Application name (optional, for diagnostics).</summary>
 33124    public string? ApplicationName { get; set; }
 25
 26    /// <summary>
 27    /// Gets or sets the maximum number of runspaces to use for script execution.
 28    /// </summary>
 6029    public int? MaxRunspaces { get; set; }
 30
 31    /// <summary>
 32    /// Gets or sets the minimum number of runspaces to use for script execution.
 33    /// Defaults to 1.
 34    /// </summary>
 71735    public int MinRunspaces { get; set; }
 36
 37    /// <summary>
 38    /// Gets or sets the maximum number of runspaces to use for the scheduler service.
 39    /// Defaults to 8.
 40    /// </summary>
 66341    public int MaxSchedulerRunspaces { get; set; }
 42
 43    /// <summary>
 44    /// Gets or sets the health endpoint configuration.
 45    /// </summary>
 131546    public HealthEndpointOptions Health { get; set; } = new();
 47
 48    /// <summary>
 49    /// List of configured listeners for the Kestrel server.
 50    /// Each listener can be configured with its own IP address, port, protocols, and other options.
 51    /// </summary>
 11552    public List<ListenerOptions> Listeners { get; }
 53
 54    /// <summary>
 55    /// Gets the HTTPS connection adapter options.
 56    /// </summary>
 5757    public HttpsConnectionAdapterOptions? HttpsConnectionAdapter { get; set; }
 58
 59    /// <summary>
 60    /// Optional path to a Unix domain socket for Kestrel to listen on.
 61    /// </summary>
 6162    public List<string> ListenUnixSockets { get; }
 63
 64    /// <summary>
 65    /// Optional name of a Named Pipe for Kestrel to listen on.
 66    /// </summary>
 6167    public List<string> NamedPipeNames { get; }
 68
 69    /// <summary>
 70    /// Gets or sets the Named Pipe transport options.
 71    /// </summary>
 5972    public NamedPipeTransportOptions? NamedPipeOptions { get; set; }
 73
 74    /// <summary>
 75    /// Initializes a new instance of the <see cref="KestrunOptions"/> class with default values.
 76    /// </summary>
 65677    public KestrunOptions()
 78    {
 79        // Set default values if needed
 65680        MinRunspaces = 1; // Default to 1 runspace
 65681        Listeners = [];
 65682        ServerOptions = new KestrelServerOptions();
 65683        MaxSchedulerRunspaces = 8; // Default max scheduler runspaces
 65684        ListenUnixSockets = [];
 65685        NamedPipeNames = [];
 65686        Health = new HealthEndpointOptions();
 65687    }
 88}