< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 8
Coverable lines: 8
Total lines: 35
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/CustomAttributeTypeTag.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 CustomAttributeTypeTag
 9    {
 10        internal const int NumberOfBits = 3;
 11        internal const int LargeRowSize = 0x00000001 << (16 - NumberOfBits);
 12        internal const uint MethodDef = 0x00000002;
 13        internal const uint MemberRef = 0x00000003;
 14        internal const uint TagMask = 0x0000007;
 15        internal const ulong TagToTokenTypeByteVector = TokenTypeIds.MethodDef >> 8 | TokenTypeIds.MemberRef;
 16        internal const TableMask TablesReferenced =
 17          TableMask.MethodDef
 18          | TableMask.MemberRef;
 19
 20        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 21        internal static EntityHandle ConvertToHandle(uint customAttributeType)
 022        {
 023            uint tokenType = unchecked((uint)(TagToTokenTypeByteVector >> ((int)(customAttributeType & TagMask) << 3)) <
 024            uint rowId = (customAttributeType >> NumberOfBits);
 25
 026            if (tokenType == 0 || (rowId & ~TokenTypeIds.RIDMask) != 0)
 027            {
 028                Throw.InvalidCodedIndex();
 29            }
 30
 031            return new EntityHandle(tokenType | rowId);
 032        }
 33    }
 34}
 35

Methods/Properties

ConvertToHandle(System.UInt32)