< Summary - Jellyfin

Information
Class: Jellyfin.Extensions.GuidExtensions
Assembly: Jellyfin.Extensions
File(s): /srv/git/jellyfin/src/Jellyfin.Extensions/GuidExtensions.cs
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 26
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
IsEmpty(...)100%11100%
IsNullOrEmpty(...)100%22100%

File(s)

/srv/git/jellyfin/src/Jellyfin.Extensions/GuidExtensions.cs

#LineLine coverage
 1using System;
 2using System.Diagnostics.CodeAnalysis;
 3
 4namespace Jellyfin.Extensions;
 5
 6/// <summary>
 7/// Guid specific extensions.
 8/// </summary>
 9public static class GuidExtensions
 10{
 11    /// <summary>
 12    /// Determine whether the guid is default.
 13    /// </summary>
 14    /// <param name="guid">The guid.</param>
 15    /// <returns>Whether the guid is the default value.</returns>
 16    public static bool IsEmpty(this Guid guid)
 633017        => guid.Equals(default);
 18
 19    /// <summary>
 20    /// Determine whether the guid is null or default.
 21    /// </summary>
 22    /// <param name="guid">The guid.</param>
 23    /// <returns>Whether the guid is null or the default valueF.</returns>
 24    public static bool IsNullOrEmpty([NotNullWhen(false)] this Guid? guid)
 7325        => guid is null || guid.Value.IsEmpty();
 26}