< Summary

Information
Class: GistBackend.Utils.EnumerableExtensions
Assembly: GistBackend
File(s): /home/runner/work/the-gist-of-it-sec/the-gist-of-it-sec/backend/GistBackend/Utils/EnumerableExtensions.cs
Line coverage
88%
Covered lines: 8
Uncovered lines: 1
Coverable lines: 9
Total lines: 26
Line coverage: 88.8%
Branch coverage
83%
Covered branches: 5
Total branches: 6
Branch coverage: 83.3%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
FilterForAllowedCategories(...)100%22100%
FilterForForbiddenCategories(...)100%22100%
FilterPaywallEntries(...)50%2266.66%

File(s)

/home/runner/work/the-gist-of-it-sec/the-gist-of-it-sec/backend/GistBackend/Utils/EnumerableExtensions.cs

#LineLine coverage
 1using GistBackend.Types;
 2
 3namespace GistBackend.Utils;
 4
 5public static class EnumerableExtensions {
 6    extension(IEnumerable<RssEntry> collection)
 7    {
 8        public IEnumerable<RssEntry>
 9            FilterForAllowedCategories(IEnumerable<string>? allowedCategories) =>
 3410            allowedCategories is null
 3411                ? collection
 4612                : collection.Where(entry => entry.Categories.Any(allowedCategories.Contains));
 13
 14        public IEnumerable<RssEntry>
 15            FilterForForbiddenCategories(IEnumerable<string>? forbiddenCategories) =>
 3416            forbiddenCategories is null
 3417                ? collection
 4018                : collection.Where(entry => !entry.Categories.Any(forbiddenCategories.Contains));
 19
 20        public IEnumerable<RssEntry>
 21            FilterPaywallEntries(string feedTitle) =>
 3422            feedTitle.Contains("Golem")
 023                ? collection.Where(entry => !entry.Title.Contains("(g+)"))
 3424                : collection;
 25    }
 26}