< Summary - Jellyfin

Information
Class: Jellyfin.Extensions.StringBuilderExtensions
Assembly: Jellyfin.Extensions
File(s): /srv/git/jellyfin/src/Jellyfin.Extensions/StringBuilderExtensions.cs
Line coverage
100%
Covered lines: 8
Uncovered lines: 0
Coverable lines: 8
Total lines: 35
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
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
AppendJoinInSingleQuotes(...)100%22100%

File(s)

/srv/git/jellyfin/src/Jellyfin.Extensions/StringBuilderExtensions.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using System.Text;
 3
 4namespace Jellyfin.Extensions
 5{
 6    /// <summary>
 7    /// Extension methods for the <see cref="StringBuilder"/> class.
 8    /// </summary>
 9    public static class StringBuilderExtensions
 10    {
 11        /// <summary>
 12        /// Concatenates and appends the members of a collection in single quotes using the specified delimiter.
 13        /// </summary>
 14        /// <param name="builder">The string builder.</param>
 15        /// <param name="delimiter">The character delimiter.</param>
 16        /// <param name="values">The collection of strings to concatenate.</param>
 17        /// <returns>The updated string builder.</returns>
 18        public static StringBuilder AppendJoinInSingleQuotes(this StringBuilder builder, char delimiter, IReadOnlyList<s
 19        {
 3820            var len = values.Count;
 38021            for (var i = 0; i < len; i++)
 22            {
 15223                builder.Append('\'')
 15224                    .Append(values[i])
 15225                    .Append('\'')
 15226                    .Append(delimiter);
 27            }
 28
 29            // remove last ,
 3830            builder.Length--;
 31
 3832            return builder;
 33        }
 34    }
 35}