< Summary - Jellyfin

Information
Class: Emby.Server.Implementations.Sorting.RandomComparer
Assembly: Emby.Server.Implementations
File(s): /srv/git/jellyfin/Emby.Server.Implementations/Sorting/RandomComparer.cs
Line coverage
50%
Covered lines: 1
Uncovered lines: 1
Coverable lines: 2
Total lines: 31
Line coverage: 50%
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

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Type()100%11100%
Compare(...)100%210%

File(s)

/srv/git/jellyfin/Emby.Server.Implementations/Sorting/RandomComparer.cs

#LineLine coverage
 1using System;
 2using Jellyfin.Data.Enums;
 3using MediaBrowser.Controller.Entities;
 4using MediaBrowser.Controller.Sorting;
 5using MediaBrowser.Model.Querying;
 6
 7namespace Emby.Server.Implementations.Sorting
 8{
 9    /// <summary>
 10    /// Class RandomComparer.
 11    /// </summary>
 12    public class RandomComparer : IBaseItemComparer
 13    {
 14        /// <summary>
 15        /// Gets the name.
 16        /// </summary>
 17        /// <value>The name.</value>
 118        public ItemSortBy Type => ItemSortBy.Random;
 19
 20        /// <summary>
 21        /// Compares the specified x.
 22        /// </summary>
 23        /// <param name="x">The x.</param>
 24        /// <param name="y">The y.</param>
 25        /// <returns>System.Int32.</returns>
 26        public int Compare(BaseItem? x, BaseItem? y)
 27        {
 028            return Guid.NewGuid().CompareTo(Guid.NewGuid());
 29        }
 30    }
 31}