< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Languages.CsGlobals
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Languages/CsGlobals.cs
Tag: Kestrun/Kestrun@2d87023b37eb91155071c91dd3d6a2eeb3004705
Line coverage
100%
Covered lines: 23
Uncovered lines: 0
Coverable lines: 23
Total lines: 74
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: 100% (23/23) Total lines: 76 Tag: Kestrun/Kestrun@07f821172e5dc3657f1be7e6818f18d6721cf38a09/12/2025 - 03:43:11 Line coverage: 100% (23/23) Total lines: 74 Tag: Kestrun/Kestrun@d160286e3020330b1eb862d66a37db2e26fc9042

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
.ctor(...)100%11100%
.ctor(...)100%11100%
.ctor(...)100%11100%
get_Globals()100%11100%
get_Locals()100%11100%
get_Context()100%11100%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Languages/CsGlobals.cs

#LineLine coverage
 1using Kestrun.Models;
 2
 3namespace Kestrun.Languages;
 4// ---------------------------------------------------------------------------
 5//  C# delegate builder  –  now takes optional imports / references
 6// ---------------------------------------------------------------------------
 7/// <summary>
 8/// Provides global and local variable dictionaries and context for C# delegate execution.
 9/// </summary>
 10public record CsGlobals
 11{
 12    /// <summary>
 13    /// Initializes a new instance of the <see cref="CsGlobals"/> class with the specified global variables.
 14    /// </summary>
 15    /// <param name="globals">A dictionary containing global variables.</param>
 616    public CsGlobals(IReadOnlyDictionary<string, object?> globals)
 17    {
 618        Globals = globals;
 619        Locals = new Dictionary<string, object?>();
 620        Context = null;
 621    }
 22
 23    /// <summary>
 24    /// Initializes a new instance of the <see cref="CsGlobals"/> class with the specified global variables and context.
 25    /// </summary>
 26    /// <param name="globals">A dictionary containing global variables.</param>
 27    /// <param name="krcontext">The Kestrun execution context.</param>
 2028    public CsGlobals(IReadOnlyDictionary<string, object?> globals, KestrunContext krcontext)
 29    {
 2030        Globals = globals;
 2031        Context = krcontext;
 2032        Locals = new Dictionary<string, object?>();
 2033    }
 34
 35    /// <summary>
 36    /// Initializes a new instance with the specified global and local variables (no execution context).
 37    /// </summary>
 38    /// <param name="globals">Global variables.</param>
 39    /// <param name="locals">Local variables.</param>
 940    public CsGlobals(IReadOnlyDictionary<string, object?> globals, IReadOnlyDictionary<string, object?> locals)
 41    {
 942        Globals = globals;
 943        Locals = locals;
 944        Context = null;
 945    }
 46
 47    /// <summary>
 48    /// Initializes a new instance of the <see cref="CsGlobals"/> class with the specified global variables, context, an
 49    /// </summary>
 50    /// <param name="globals">A dictionary containing global variables.</param>
 51    /// <param name="krcontext">The Kestrun execution context.</param>
 52    /// <param name="locals">A dictionary containing local variables.</param>
 1353    public CsGlobals(IReadOnlyDictionary<string, object?> globals, KestrunContext krcontext, IReadOnlyDictionary<string,
 54    {
 1355        Globals = globals;
 1356        Context = krcontext;
 1357        Locals = locals;
 1358    }
 59
 60    /// <summary>
 61    /// Gets the dictionary containing global variables for delegate execution.
 62    /// </summary>
 14663    public IReadOnlyDictionary<string, object?> Globals { get; }
 64
 65    /// <summary>
 66    /// Gets the dictionary containing local variables for delegate execution.
 67    /// </summary>
 3068    public IReadOnlyDictionary<string, object?> Locals { get; }
 69
 70    /// <summary>
 71    /// Gets the Kestrun execution context for delegate execution.
 72    /// </summary>
 5373    public KestrunContext? Context { get; }
 74}