< Summary - Jellyfin

Information
Class: Jellyfin.Server.Filters.ParameterObsoleteFilter
Assembly: jellyfin
File(s): /srv/git/jellyfin/Jellyfin.Server/Filters/ParameterObsoleteFilter.cs
Line coverage
100%
Covered lines: 12
Uncovered lines: 0
Coverable lines: 12
Total lines: 42
Line coverage: 100%
Branch coverage
91%
Covered branches: 11
Total branches: 12
Branch coverage: 91.6%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 11/28/2025 - 12:11:11 AM Line coverage: 100% (10/10) Branch coverage: 87.5% (7/8) Total lines: 362/27/2026 - 12:13:29 AM Line coverage: 100% (12/12) Branch coverage: 91.6% (11/12) Total lines: 42 11/28/2025 - 12:11:11 AM Line coverage: 100% (10/10) Branch coverage: 87.5% (7/8) Total lines: 362/27/2026 - 12:13:29 AM Line coverage: 100% (12/12) Branch coverage: 91.6% (11/12) Total lines: 42

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Apply(...)91.66%1212100%

File(s)

/srv/git/jellyfin/Jellyfin.Server/Filters/ParameterObsoleteFilter.cs

#LineLine coverage
 1using System;
 2using System.Linq;
 3using Jellyfin.Api.Attributes;
 4using Microsoft.OpenApi;
 5using Swashbuckle.AspNetCore.SwaggerGen;
 6
 7namespace Jellyfin.Server.Filters
 8{
 9    /// <summary>
 10    /// Mark parameter as deprecated if it has the <see cref="ParameterObsoleteAttribute"/>.
 11    /// </summary>
 12    public class ParameterObsoleteFilter : IOperationFilter
 13    {
 14        /// <inheritdoc />
 15        public void Apply(OpenApiOperation operation, OperationFilterContext context)
 16        {
 576417            foreach (var parameterDescription in context.ApiDescription.ParameterDescriptions)
 18            {
 249519                if (parameterDescription
 249520                    .CustomAttributes()
 249521                    .OfType<ParameterObsoleteAttribute>()
 249522                    .Any())
 23                {
 4224                    if (operation.Parameters is null)
 25                    {
 26                        continue;
 27                    }
 28
 61629                    foreach (var parameter in operation.Parameters)
 30                    {
 28731                        if (parameter is OpenApiParameter concreteParam
 28732                            && string.Equals(concreteParam.Name, parameterDescription.Name, StringComparison.Ordinal))
 33                        {
 4234                            concreteParam.Deprecated = true;
 4235                            break;
 36                        }
 37                    }
 38                }
 39            }
 38740        }
 41    }
 42}