< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 27
Coverable lines: 27
Total lines: 70
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
.ctor(...)100%110%
GetDefaultValue()100%110%
GetMarshallingDescriptor()0%220%
GetCustomAttributes()100%110%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/TypeSystem/Parameter.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    public readonly struct Parameter
 7    {
 8        private readonly MetadataReader _reader;
 9
 10        // Workaround: JIT doesn't generate good code for nested structures, so use RowId.
 11        private readonly int _rowId;
 12
 13        internal Parameter(MetadataReader reader, ParameterHandle handle)
 014        {
 015            _reader = reader;
 016            _rowId = handle.RowId;
 017        }
 18
 19        private ParameterHandle Handle
 20        {
 021            get { return ParameterHandle.FromRowId(_rowId); }
 22        }
 23
 24        public ParameterAttributes Attributes
 25        {
 26            get
 027            {
 028                return _reader.ParamTable.GetFlags(Handle);
 029            }
 30        }
 31
 32        public int SequenceNumber
 33        {
 34            get
 035            {
 036                return _reader.ParamTable.GetSequence(Handle);
 037            }
 38        }
 39
 40        public StringHandle Name
 41        {
 42            get
 043            {
 044                return _reader.ParamTable.GetName(Handle);
 045            }
 46        }
 47
 48        public ConstantHandle GetDefaultValue()
 049        {
 050            return _reader.ConstantTable.FindConstant(Handle);
 051        }
 52
 53        public BlobHandle GetMarshallingDescriptor()
 054        {
 055            int marshalRowId = _reader.FieldMarshalTable.FindFieldMarshalRowId(Handle);
 056            if (marshalRowId == 0)
 057            {
 058                return default(BlobHandle);
 59            }
 60
 061            return _reader.FieldMarshalTable.GetNativeType(marshalRowId);
 062        }
 63
 64        public CustomAttributeHandleCollection GetCustomAttributes()
 065        {
 066            return new CustomAttributeHandleCollection(_reader, Handle);
 067        }
 68    }
 69}
 70