< Summary

Information
Class: RoleRadar.Application.Reading.PostingOrderingExtensions
Assembly: RoleRadar.Application
File(s): /home/runner/work/roleradar/roleradar/src/RoleRadar.Application/Reading/PostingOrderingExtensions.cs
Line coverage
62%
Covered lines: 5
Uncovered lines: 3
Coverable lines: 8
Total lines: 23
Line coverage: 62.5%
Branch coverage
62%
Covered branches: 5
Total branches: 8
Branch coverage: 62.5%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
OrderByDisposition(...)100%22100%
ThenByDisposition(...)50%22100%
OrderByScore(...)100%22100%
ThenByScore(...)0%620%

File(s)

/home/runner/work/roleradar/roleradar/src/RoleRadar.Application/Reading/PostingOrderingExtensions.cs

#LineLine coverage
 1namespace RoleRadar.Application.Reading;
 2
 3using System.Linq;
 4using RoleRadar.Application.Reading.Models;
 5
 6public static class PostingOrderingExtensions
 7{
 8    public static IOrderedQueryable<PostingReadModel> OrderByDisposition(this IQueryable<PostingReadModel> source, bool 
 89        => descending ? source.OrderByDescending(p => p.DispositionRank) : source.OrderBy(p => p.DispositionRank);
 10
 11    public static IOrderedQueryable<PostingReadModel> ThenByDisposition(this IOrderedQueryable<PostingReadModel> source,
 412        => descending ? source.ThenByDescending(p => p.DispositionRank) : source.ThenBy(p => p.DispositionRank);
 13
 14    public static IOrderedQueryable<PostingReadModel> OrderByScore(this IQueryable<PostingReadModel> source, bool descen
 6215        => descending
 6216            ? source.OrderByDescending(p => p.HasScore).ThenByDescending(p => p.Score)
 6217            : source.OrderByDescending(p => p.HasScore).ThenBy(p => p.Score);
 18
 19    public static IOrderedQueryable<PostingReadModel> ThenByScore(this IOrderedQueryable<PostingReadModel> source, bool 
 020        => descending
 021            ? source.ThenByDescending(p => p.HasScore).ThenByDescending(p => p.Score)
 022            : source.ThenByDescending(p => p.HasScore).ThenBy(p => p.Score);
 23}