< 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@0d738bf294e6281b936d031e1979d928007495ff
Line coverage
100%
Covered lines: 14
Uncovered lines: 0
Coverable lines: 14
Total lines: 62
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@7c4ce528870211ad6c2d2398c31ec13097fc584012/12/2025 - 17:27:19 Line coverage: 100% (14/14) Branch coverage: 100% (4/4) Total lines: 62 Tag: Kestrun/Kestrun@826bf9dcf9db118c5de4c78a3259bce9549f0dcd 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@7c4ce528870211ad6c2d2398c31ec13097fc584012/12/2025 - 17:27:19 Line coverage: 100% (14/14) Branch coverage: 100% (4/4) Total lines: 62 Tag: Kestrun/Kestrun@826bf9dcf9db118c5de4c78a3259bce9549f0dcd

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%
get_Parameters()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.Languages;
 5using Kestrun.Scripting;
 6
 7namespace Kestrun.Hosting.Options;
 8/// <summary>
 9/// Base options for specifying script code and language settings.
 10/// </summary>
 11public record LanguageOptions
 12{
 13    /// <summary>
 14    /// The script code to execute for this route.
 15    /// </summary>
 18116    public string? Code { get; set; }
 17    /// <summary>
 18    /// The scripting language used for the route's code.
 19    /// </summary>
 37720    public ScriptLanguage Language { get; set; } = ScriptLanguage.PowerShell;
 21    /// <summary>
 22    /// Additional import namespaces required for the script code.
 23    /// </summary>
 5324    public string[]? ExtraImports { get; set; }
 25    /// <summary>
 26    /// Additional assembly references required for the script code.
 27    /// </summary>
 5328    public Assembly[]? ExtraRefs { get; set; }
 29
 30    /// <summary>
 31    /// The script block created from the <see cref="Code"/> property, or null if no code is set.
 32    /// </summary>
 33    public ScriptBlock? ScriptBlock
 34    {
 535        get => string.IsNullOrWhiteSpace(Code) ? null : ScriptBlock.Create(Code);
 36        set
 37        {
 238            if (value is null)
 39            {
 140                Code = null;
 141                return;
 42            }
 143            Code = value.ToString();
 144            Language = ScriptLanguage.PowerShell;
 145        }
 46    }
 47
 48    /// <summary>
 49    /// Additional metadata for the route, represented as key-value pairs.
 50    /// </summary>
 22851    public Dictionary<string, object?>? Arguments { get; set; } = new Dictionary<string, object?>(StringComparer.Ordinal
 52
 53    /// <summary>
 54    /// Version of the C# language to use when <see cref="Language"/> is <see cref="ScriptLanguage.CSharp"/>.
 55    /// </summary>
 16756    public Microsoft.CodeAnalysis.CSharp.LanguageVersion LanguageVersion { get; set; } = Microsoft.CodeAnalysis.CSharp.L
 57
 58    /// <summary>
 59    /// Parameters to be injected into the script.
 60    /// </summary>
 21661    public List<ParameterForInjectionInfo> Parameters { get; internal set; } = [];
 62}