< Summary

Information
Class: Punch.CLI.SlotTime
Assembly: punch
File(s): /home/runner/work/punch/punch/src/Punch.CLI/SlotTime.cs
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 18
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ToTime(...)100%11100%
FormatRange(...)100%11100%

File(s)

/home/runner/work/punch/punch/src/Punch.CLI/SlotTime.cs

#LineLine coverage
 1namespace Punch.CLI;
 2
 3// Helpers for converting 15-minute slot indices (0..96) into clock times.
 4internal static class SlotTime
 5{
 6    public static (int Hours, int Minutes) ToTime(int slot)
 107    {
 108        return (slot / 4, (slot % 4) * 15);
 109    }
 10
 11    // Formats a slot range as "HH:MM–HH:MM" (en-dash separator).
 12    public static string FormatRange(int startSlot, int endSlot)
 313    {
 314        var (sh, sm) = ToTime(startSlot);
 315        var (eh, em) = ToTime(endSlot);
 316        return $"{sh:D2}:{sm:D2}–{eh:D2}:{em:D2}";
 317    }
 18}