< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 8
Coverable lines: 8
Total lines: 32
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

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

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/PortablePdb/LocalVariable.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
 4namespace System.Reflection.Metadata
 5{
 6    /// <summary>
 7    /// Local variable. Stored in debug metadata.
 8    /// </summary>
 9    /// <remarks>
 10    /// See https://github.com/dotnet/runtime/blob/main/src/libraries/System.Reflection.Metadata/specs/PortablePdb-Metad
 11    /// </remarks>
 12    public readonly struct LocalVariable
 13    {
 14        private readonly MetadataReader _reader;
 15
 16        // Workaround: JIT doesn't generate good code for nested structures, so use RowId.
 17        private readonly int _rowId;
 18
 19        internal LocalVariable(MetadataReader reader, LocalVariableHandle handle)
 020        {
 021            _reader = reader;
 022            _rowId = handle.RowId;
 023        }
 24
 025        private LocalVariableHandle Handle => LocalVariableHandle.FromRowId(_rowId);
 26
 027        public LocalVariableAttributes Attributes => _reader.LocalVariableTable.GetAttributes(Handle);
 028        public int Index => _reader.LocalVariableTable.GetIndex(Handle);
 029        public StringHandle Name => _reader.LocalVariableTable.GetName(Handle);
 30    }
 31}
 32