< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 8
Coverable lines: 8
Total lines: 37
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
ConvertToHandle(...)0%440%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Internal/ImplementationTag.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.Runtime.CompilerServices;
 5
 6namespace System.Reflection.Metadata.Ecma335
 7{
 8    internal static class ImplementationTag
 9    {
 10        internal const int NumberOfBits = 2;
 11        internal const int LargeRowSize = 0x00000001 << (16 - NumberOfBits);
 12        internal const uint File = 0x00000000;
 13        internal const uint AssemblyRef = 0x00000001;
 14        internal const uint ExportedType = 0x00000002;
 15        internal const uint TagMask = 0x00000003;
 16        internal const uint TagToTokenTypeByteVector = TokenTypeIds.File >> 24 | TokenTypeIds.AssemblyRef >> 16 | TokenT
 17        internal const TableMask TablesReferenced =
 18          TableMask.File
 19          | TableMask.AssemblyRef
 20          | TableMask.ExportedType;
 21
 22        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 23        internal static EntityHandle ConvertToHandle(uint implementation)
 024        {
 025            uint tokenType = (TagToTokenTypeByteVector >> ((int)(implementation & TagMask) << 3)) << TokenTypeIds.RowIdB
 026            uint rowId = (implementation >> NumberOfBits);
 27
 028            if (tokenType == 0 || (rowId & ~TokenTypeIds.RIDMask) != 0)
 029            {
 030                Throw.InvalidCodedIndex();
 31            }
 32
 033            return new EntityHandle(tokenType | rowId);
 034        }
 35    }
 36}
 37

Methods/Properties

ConvertToHandle(System.UInt32)