< Summary - Syki

Information
Class: Syki.Back.Extensions.ListExtensions
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Extensions/ListExtensions.cs
Tag: 4_16869239191
Line coverage
33%
Covered lines: 1
Uncovered lines: 2
Coverable lines: 3
Total lines: 16
Line coverage: 33.3%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
GetAverageNote(...)50%3233.33%

File(s)

/home/runner/work/syki/syki/Back/Extensions/ListExtensions.cs

#LineLine coverage
 1using Syki.Back.Features.Teacher.AddClassActivityNote;
 2
 3namespace Syki.Back.Extensions;
 4
 5public static class ListExtensions
 6{
 7    extension(List<StudentClassNote> notes)
 8    {
 9        public decimal GetAverageNote()
 10        {
 411            if (notes.Count <= 2) return 0;
 012            var average = notes.Select(x => x.Note).OrderDescending().Take(2).Average();
 013            return Math.Round(average, 2);
 14        }
 15    }
 16}