< Summary

Class:Itinero.Profiles.Lua.LuaTableExtensions
Assembly:Itinero.Profiles.Lua
File(s):/home/runner/work/routing2/routing2/src/Itinero.Profiles.Lua/LuaTableExtensions.cs
Covered lines:16
Uncovered lines:1
Coverable lines:17
Total lines:33
Line coverage:94.1% (16 of 17)
Covered branches:9
Total branches:10
Branch coverage:90% (9 of 10)
Tag:263_26948838820

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
GetDouble(...)100%4100%
GetBoolean(...)83.33%690%

File(s)

/home/runner/work/routing2/routing2/src/Itinero.Profiles.Lua/LuaTableExtensions.cs

#LineLine coverage
 1using MoonSharp.Interpreter;
 2
 3namespace Itinero.Profiles.Lua;
 4
 5internal static class LuaTableExtensions
 6{
 7    internal static double? GetDouble(this Table table, string key)
 72188    {
 72189        var val = table.Get(key);
 721810        if (val.IsNil() || val.IsVoid())
 235811        {
 235812            return null;
 13        }
 14
 486015        return val.CastToNumber();
 721816    }
 17
 18    internal static bool? GetBoolean(this Table table, string key)
 179119    {
 179120        var val = table.Get(key);
 179121        if (val.IsNil() || val.IsVoid())
 120322        {
 120323            return null;
 24        }
 25
 58826        if (val.Type == DataType.Boolean)
 58827        {
 58828            return val.Boolean;
 29        }
 30
 031        return val.CastToBool();
 179132    }
 33}

Methods/Properties

GetDouble(...)
GetBoolean(...)