< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 8
Coverable lines: 8
Total lines: 39
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
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%220%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Internal/ResolutionScopeTag.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 ResolutionScopeTag
 9    {
 10        internal const int NumberOfBits = 2;
 11        internal const int LargeRowSize = 0x00000001 << (16 - NumberOfBits);
 12        internal const uint Module = 0x00000000;
 13        internal const uint ModuleRef = 0x00000001;
 14        internal const uint AssemblyRef = 0x00000002;
 15        internal const uint TypeRef = 0x00000003;
 16        internal const uint TagMask = 0x00000003;
 17        internal const uint TagToTokenTypeByteVector = TokenTypeIds.Module >> 24 | TokenTypeIds.ModuleRef >> 16 | TokenT
 18        internal const TableMask TablesReferenced =
 19          TableMask.Module
 20          | TableMask.ModuleRef
 21          | TableMask.AssemblyRef
 22          | TableMask.TypeRef;
 23
 24        [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
 25        internal static EntityHandle ConvertToHandle(uint resolutionScope)
 026        {
 027            uint tokenType = (TagToTokenTypeByteVector >> ((int)(resolutionScope & TagMask) << 3)) << TokenTypeIds.RowId
 028            uint rowId = (resolutionScope >> NumberOfBits);
 29
 030            if ((rowId & ~TokenTypeIds.RIDMask) != 0)
 031            {
 032                Throw.InvalidCodedIndex();
 33            }
 34
 035            return new EntityHandle(tokenType | rowId);
 036        }
 37    }
 38}
 39

Methods/Properties

ConvertToHandle(System.UInt32)