< 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:18
Uncovered lines:5
Coverable lines:23
Total lines:43
Line coverage:78.2% (18 of 23)
Covered branches:9
Total branches:16
Branch coverage:56.2% (9 of 16)
Tag:224_14471318300

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
GetDouble(...)80%1092.3%
GetBoolean(...)16.66%660%

File(s)

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

#LineLine coverage
 1using Neo.IronLua;
 2
 3namespace Itinero.Profiles.Lua;
 4
 5internal static class LuaTableExtensions
 6{
 7    internal static double? GetDouble(this LuaTable table, string key)
 138    {
 139        var obj = table[key];
 1310        if (obj == null)
 611        {
 612            return null;
 13        }
 14
 715        if (obj is double d)
 316        {
 317            return d;
 18        }
 19
 420        if (obj is int i)
 421        {
 422            return i;
 23        }
 24
 025        return (double)obj;
 1326    }
 27
 28    internal static bool? GetBoolean(this LuaTable table, string key)
 329    {
 330        var obj = table[key];
 331        if (obj == null)
 332        {
 333            return null;
 34        }
 35
 036        if (obj is bool b)
 037        {
 038            return b;
 39        }
 40
 041        return (bool)obj;
 342    }
 43}

Methods/Properties

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