< Summary

Information
Class: DirectSight.Parser.Analysis.FileAnalysis
Assembly DirectSight
File(s): /home/runner/work/DirectSight/DirectSight/DirectSight/Parser/Analysis/FileAnalysis.cs
Line coverage
83%
Covered lines: 15
Uncovered lines: 3
Coverable lines: 18
Total lines: 72
Line coverage: 83.3%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%11100%
.ctor(...)100%11100%
ToString()100%110%
AddLineAnalysis(...)100%11100%

File(s)

/home/runner/work/DirectSight/DirectSight/DirectSight/Parser/Analysis/FileAnalysis.cs

#LineLine coverage
 1using System.Collections.Generic;
 2
 3namespace DirectSight.Parser.Analysis;
 4
 5/// <summary>
 6/// Coverage information of a source file.
 7/// </summary>
 8public class FileAnalysis
 9{
 10    /// <summary>
 11    /// The coverage information of the lines in the source file.
 12    /// </summary>
 6513    private readonly List<LineAnalysis> lineAnalysis = [];
 14
 15    /// <summary>
 16    /// Initializes a new instance of the <see cref="FileAnalysis"/> class.
 17    /// </summary>
 18    /// <param name="path">The path of the source file.</param>
 6519    internal FileAnalysis(string path)
 6520    {
 6521        this.Path = path;
 6522    }
 23
 24    /// <summary>
 25    /// Initializes a new instance of the <see cref="FileAnalysis"/> class.
 26    /// </summary>
 27    /// <param name="path">The path of the source file.</param>
 28    /// <param name="error">The error.</param>
 29    internal FileAnalysis(string path, string error)
 6530        : this(path)
 6531    {
 6532        this.Error = error;
 6533    }
 34
 35    /// <summary>
 36    /// Gets the path.
 37    /// </summary>
 38    /// <value>The path.</value>
 4239    public string Path { get; }
 40
 41    /// <summary>
 42    /// Gets the error.
 43    /// </summary>
 44    /// <value>The error.</value>
 4045    public string Error { get; }
 46
 47    /// <summary>
 48    /// Gets the coverage information of the lines in the file.
 49    /// </summary>
 50    /// <value>The lines.</value>
 28351    public IEnumerable<LineAnalysis> Lines => this.lineAnalysis;
 52
 53    /// <summary>
 54    /// Returns a <see cref="string" /> that represents this instance.
 55    /// </summary>
 56    /// <returns>
 57    /// A <see cref="string" /> that represents this instance.
 58    /// </returns>
 59    public override string ToString()
 060    {
 061        return this.Path;
 062    }
 63
 64    /// <summary>
 65    /// Adds the given line analysis to the file analysis.
 66    /// </summary>
 67    /// <param name="lineAnalysis">The line analysis.</param>
 68    internal void AddLineAnalysis(LineAnalysis lineAnalysis)
 254269    {
 254270        this.lineAnalysis.Add(lineAnalysis);
 254271    }
 72}