< Summary

Class:Itinero.Instructions.Utils
Assembly:Itinero.Instructions
File(s):/home/runner/work/routing2/routing2/src/Itinero.Instructions/Utils.cs
Covered lines:11
Uncovered lines:0
Coverable lines:11
Total lines:32
Line coverage:100% (11 of 11)
Covered branches:4
Total branches:4
Branch coverage:100% (4 of 4)
Tag:224_14471318300

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
NormalizeDegrees(...)100%4100%

File(s)

/home/runner/work/routing2/routing2/src/Itinero.Instructions/Utils.cs

#LineLine coverage
 1using System;
 2using Itinero.Routes;
 3
 4namespace Itinero.Instructions;
 5
 6internal class Box<T>
 7{
 8    public T Content { get; set; }
 9}
 10
 11internal static class Utils
 12{
 13
 14    /**
 15     * Normalizes degrees to be between -180 (incl) and 180 (excl)
 16     */
 17    internal static int NormalizeDegrees(this double degrees)
 14818    {
 14819        if (degrees <= -180)
 720        {
 721            degrees += 360;
 722        }
 23
 14824        if (degrees > 180)
 1425        {
 1426            degrees -= 360;
 1427        }
 28
 14829        return (int)degrees;
 14830    }
 31
 32}

Methods/Properties

NormalizeDegrees(...)