< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Scripting.LanguageRuntimeExtensions
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Scripting/LanguageRuntimeExtensions.cs
Tag: Kestrun/Kestrun@ca54e35c77799b76774b3805b6f075cdbc0c5fbe
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 28
Line coverage: 100%
Branch coverage
75%
Covered branches: 3
Total branches: 4
Branch coverage: 75%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 09/08/2025 - 20:34:03 Line coverage: 42.8% (3/7) Branch coverage: 0% (0/4) Total lines: 28 Tag: Kestrun/Kestrun@3790ee5884494a7a2a829344a47743e0bf492e7212/12/2025 - 17:27:19 Line coverage: 0% (0/7) Branch coverage: 0% (0/4) Total lines: 28 Tag: Kestrun/Kestrun@826bf9dcf9db118c5de4c78a3259bce9549f0dcd12/15/2025 - 02:23:46 Line coverage: 42.8% (3/7) Branch coverage: 0% (0/4) Total lines: 28 Tag: Kestrun/Kestrun@7a3839f4de2254e22daae81ab8dc7cb2f40c833001/12/2026 - 18:03:06 Line coverage: 100% (7/7) Branch coverage: 75% (3/4) Total lines: 28 Tag: Kestrun/Kestrun@956332ccc921363590dccd99d5707fb20b50966b 09/08/2025 - 20:34:03 Line coverage: 42.8% (3/7) Branch coverage: 0% (0/4) Total lines: 28 Tag: Kestrun/Kestrun@3790ee5884494a7a2a829344a47743e0bf492e7212/12/2025 - 17:27:19 Line coverage: 0% (0/7) Branch coverage: 0% (0/4) Total lines: 28 Tag: Kestrun/Kestrun@826bf9dcf9db118c5de4c78a3259bce9549f0dcd12/15/2025 - 02:23:46 Line coverage: 42.8% (3/7) Branch coverage: 0% (0/4) Total lines: 28 Tag: Kestrun/Kestrun@7a3839f4de2254e22daae81ab8dc7cb2f40c833001/12/2026 - 18:03:06 Line coverage: 100% (7/7) Branch coverage: 75% (3/4) Total lines: 28 Tag: Kestrun/Kestrun@956332ccc921363590dccd99d5707fb20b50966b

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
UseLanguageRuntime(...)75%44100%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Scripting/LanguageRuntimeExtensions.cs

#LineLine coverage
 1namespace Kestrun.Scripting;
 2
 3/// <summary>
 4/// Extension methods for <see cref="IApplicationBuilder"/> to support language-based runtime configuration.
 5/// </summary>
 6public static class LanguageRuntimeExtensions
 7{
 8    /// <summary>
 9    /// Configures the application pipeline to use a specific language runtime for endpoints tagged with the given <see 
 10    /// </summary>
 11    /// <param name="app">The application builder to configure.</param>
 12    /// <param name="language">The script language to filter endpoints by.</param>
 13    /// <param name="configure">The configuration action to apply when the language matches.</param>
 14    /// <returns>The configured <see cref="IApplicationBuilder"/> instance.</returns>
 15    public static IApplicationBuilder UseLanguageRuntime(
 16        this IApplicationBuilder app,
 17        ScriptLanguage language,
 18        Action<IApplicationBuilder> configure)
 19    {
 320        return app.UseWhen(context =>
 321        {
 322            var attr =
 323                context.GetEndpoint()?.Metadata
 324                   .GetMetadata<ScriptLanguageAttribute>();
 325            return attr?.Language == language;
 326        }, configure);
 27    }
 28}