< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 44
Coverable lines: 44
Total lines: 74
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 14
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%
.ctor(...)100%110%
GetHashCode()100%110%
Equals(...)0%220%
Equals(...)0%10100%
GetDebuggerDisplay()0%220%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/PortablePdb/SequencePoint.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System.Diagnostics;
 5using System.Diagnostics.CodeAnalysis;
 6using System.Reflection.Internal;
 7
 8namespace System.Reflection.Metadata
 9{
 10    [DebuggerDisplay("{GetDebuggerDisplay(),nq}")]
 11    public readonly struct SequencePoint : IEquatable<SequencePoint>
 12    {
 13        public const int HiddenLine = 0xfeefee;
 14
 015        public DocumentHandle Document { get; }
 016        public int Offset { get; }
 017        public int StartLine { get; }
 018        public int EndLine { get; }
 019        public int StartColumn { get; }
 020        public int EndColumn { get; }
 21
 22        internal SequencePoint(DocumentHandle document, int offset)
 023        {
 024            Document = document;
 025            Offset = offset;
 026            StartLine = HiddenLine;
 027            StartColumn = 0;
 028            EndLine = HiddenLine;
 029            EndColumn = 0;
 030        }
 31
 32        internal SequencePoint(DocumentHandle document, int offset, int startLine, ushort startColumn, int endLine, usho
 033        {
 034            Document = document;
 035            Offset = offset;
 036            StartLine = startLine;
 037            StartColumn = startColumn;
 038            EndLine = endLine;
 039            EndColumn = endColumn;
 040        }
 41
 42        public override int GetHashCode()
 043        {
 044            return Hash.Combine(Document.RowId,
 045                   Hash.Combine(Offset,
 046                   Hash.Combine(StartLine,
 047                   Hash.Combine(StartColumn,
 048                   Hash.Combine(EndLine, EndColumn)))));
 049        }
 50
 51        public override bool Equals([NotNullWhen(true)] object? obj)
 052        {
 053            return obj is SequencePoint sequencePoint && Equals(sequencePoint);
 054        }
 55
 56        public bool Equals(SequencePoint other)
 057        {
 058            return Document == other.Document
 059                && Offset == other.Offset
 060                && StartLine == other.StartLine
 061                && StartColumn == other.StartColumn
 062                && EndLine == other.EndLine
 063                && EndColumn == other.EndColumn;
 064        }
 65
 066        public bool IsHidden => StartLine == 0xfeefee;
 67
 68        private string GetDebuggerDisplay()
 069        {
 070            return IsHidden ? "<hidden>" : $"{Offset}: ({StartLine}, {StartColumn}) - ({EndLine}, {EndColumn})";
 071        }
 72    }
 73}
 74