< 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:251_23667616543

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)
 71688    {
 71689        var val = table.Get(key);
 716810        if (val.IsNil() || val.IsVoid())
 235611        {
 235612            return null;
 13        }
 14
 481215        return val.CastToNumber();
 716816    }
 17
 18    internal static bool? GetBoolean(this Table table, string key)
 178519    {
 178520        var val = table.Get(key);
 178521        if (val.IsNil() || val.IsVoid())
 119522        {
 119523            return null;
 24        }
 25
 59026        if (val.Type == DataType.Boolean)
 59027        {
 59028            return val.Boolean;
 29        }
 30
 031        return val.CastToBool();
 178532    }
 33}

Methods/Properties

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