< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Hosting.Options.LanguageOptions
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/Options/LanguageOptions.cs
Tag: Kestrun/Kestrun@2d87023b37eb91155071c91dd3d6a2eeb3004705
Line coverage
100%
Covered lines: 13
Uncovered lines: 0
Coverable lines: 13
Total lines: 56
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 10/13/2025 - 16:52:37 Line coverage: 100% (12/12) Branch coverage: 100% (4/4) Total lines: 51 Tag: Kestrun/Kestrun@10d476bee71c71ad215bb8ab59f219887b5b4a5e10/15/2025 - 01:01:18 Line coverage: 100% (13/13) Branch coverage: 100% (4/4) Total lines: 56 Tag: Kestrun/Kestrun@7c4ce528870211ad6c2d2398c31ec13097fc5840 10/13/2025 - 16:52:37 Line coverage: 100% (12/12) Branch coverage: 100% (4/4) Total lines: 51 Tag: Kestrun/Kestrun@10d476bee71c71ad215bb8ab59f219887b5b4a5e10/15/2025 - 01:01:18 Line coverage: 100% (13/13) Branch coverage: 100% (4/4) Total lines: 56 Tag: Kestrun/Kestrun@7c4ce528870211ad6c2d2398c31ec13097fc5840

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Code()100%11100%
get_Language()100%11100%
get_ExtraImports()100%11100%
get_ExtraRefs()100%11100%
get_ScriptBlock()100%22100%
set_ScriptBlock(...)100%22100%
get_Arguments()100%11100%
get_LanguageVersion()100%11100%

File(s)

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

#LineLine coverage
 1
 2using System.Management.Automation;
 3using System.Reflection;
 4using Kestrun.Scripting;
 5
 6namespace Kestrun.Hosting.Options;
 7/// <summary>
 8/// Base options for specifying script code and language settings.
 9/// </summary>
 10public record LanguageOptions
 11{
 12    /// <summary>
 13    /// The script code to execute for this route.
 14    /// </summary>
 18215    public string? Code { get; set; }
 16    /// <summary>
 17    /// The scripting language used for the route's code.
 18    /// </summary>
 37819    public ScriptLanguage Language { get; set; } = ScriptLanguage.PowerShell;
 20    /// <summary>
 21    /// Additional import namespaces required for the script code.
 22    /// </summary>
 5323    public string[]? ExtraImports { get; set; }
 24    /// <summary>
 25    /// Additional assembly references required for the script code.
 26    /// </summary>
 5327    public Assembly[]? ExtraRefs { get; set; }
 28
 29    /// <summary>
 30    /// The script block created from the <see cref="Code"/> property, or null if no code is set.
 31    /// </summary>
 32    public ScriptBlock? ScriptBlock
 33    {
 634        get => string.IsNullOrWhiteSpace(Code) ? null : ScriptBlock.Create(Code);
 35        set
 36        {
 237            if (value is null)
 38            {
 139                Code = null;
 140                return;
 41            }
 142            Code = value.ToString();
 143            Language = ScriptLanguage.PowerShell;
 144        }
 45    }
 46
 47    /// <summary>
 48    /// Additional metadata for the route, represented as key-value pairs.
 49    /// </summary>
 23050    public Dictionary<string, object?>? Arguments { get; set; } = new Dictionary<string, object?>(StringComparer.Ordinal
 51
 52    /// <summary>
 53    /// Version of the C# language to use when <see cref="Language"/> is <see cref="ScriptLanguage.CSharp"/>.
 54    /// </summary>
 16755    public Microsoft.CodeAnalysis.CSharp.LanguageVersion LanguageVersion { get; set; } = Microsoft.CodeAnalysis.CSharp.L
 56}