< Summary

Information
Class: DirectSight.Parser.Analysis.LineCoverage.LineInfoFactory
Assembly DirectSight
File(s): /home/runner/work/DirectSight/DirectSight/DirectSight/Parser/Analysis/LineCoverage/LineInfoFactory.cs
Line coverage
71%
Covered lines: 5
Uncovered lines: 2
Coverable lines: 7
Total lines: 31
Line coverage: 71.4%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
Create(...)50%2271.42%

File(s)

/home/runner/work/DirectSight/DirectSight/DirectSight/Parser/Analysis/LineCoverage/LineInfoFactory.cs

#LineLine coverage
 1namespace DirectSight.Parser.Analysis.LineCoverage;
 2
 3/// <summary>
 4/// Factory for creating instances of <see cref="ILineInfo{T}"/>. The factory decides which implementation to use based 
 5/// </summary>
 6internal static class LineInfoFactory
 7{
 8    /// <summary>
 9    /// Creates a new instance of an <see cref="ILineInfo{T}"/> implementation with the specified length and default val
 10    /// </summary>
 11    /// <remarks>For smaller lengths, an array-based implementation is used for faster enumeration.
 12    /// For larger or sparse data sets, a dictionary-based implementation is used for improved memory
 13    /// efficiency.</remarks>
 14    /// <typeparam name="T">The type of the values stored in the line information.</typeparam>
 15    /// <param name="length">The total number of elements in the line information. Must be non-negative.</param>
 16    /// <param name="defaultValue">The value to assign to all elements initially.</param>
 17    /// <returns>An <see cref="ILineInfo{T}"/> instance containing the specified number of elements, each initialized to
 18    /// value.</returns>
 19    public static ILineInfo<T> Create<T>(long length, T defaultValue)
 705820    {
 21        // Array-based implementation is faster when enumerating the results. The dictionary-based implementation is mor
 705822        if (length < 2000)
 705823        {
 705824            return new ArrayBasedLineInfo<T>(length, defaultValue);
 25        }
 26        else
 027        {
 028            return new DictionaryBasedLineInfo<T>(length, defaultValue);
 29        }
 705830    }
 31}

Methods/Properties

Create(System.Int64,T)