< Summary

Class:GDX.Reflection
Assembly:GDX
File(s):./Packages/com.dotbunny.gdx/GDX/Reflection.cs
Covered lines:120
Uncovered lines:3
Coverable lines:123
Total lines:333
Line coverage:97.5% (120 of 123)
Covered branches:0
Total branches:0
Covered methods:11
Total methods:12
Method coverage:91.6% (11 of 12)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Reflection()0%110100%
GetDefault(...)0%3.043083.33%
GetType(...)0%33092.86%
GetTypeQualifiedName(...)0%2100%
InvokeStaticMethod(...)0%4.14081.82%
InvokeMethod(...)0%440100%
SetFieldOrPropertyValue(...)0%4.74064.71%
SetFieldValue(...)0%3.053081.82%
SetPropertyValue(...)0%3.053081.82%
TryGetFieldValue[T](...)0%3.513061.54%
TryGetFieldOrPropertyValue(...)0%5.194057.89%
TryGetPropertyValue[T](...)0%3.513061.54%

File(s)

./Packages/com.dotbunny.gdx/GDX/Reflection.cs

#LineLine coverage
 1// Copyright (c) 2020-2024 dotBunny Inc.
 2// dotBunny licenses this file to you under the BSL-1.0 license.
 3// See the LICENSE file in the project root for more information.
 4
 5using System;
 6using System.Reflection;
 7using Object = UnityEngine.Object;
 8
 9namespace GDX
 10{
 11    /// <summary>
 12    ///     A collection of reflection related helper utilities.
 13    /// </summary>
 14    /// <remarks>Torn about the existence of this utility class, yet alone the conditions dictating it.</remarks>
 15    public static class Reflection
 16    {
 17        /// <summary>
 18        ///     <see cref="BindingFlags" /> for a private field.
 19        /// </summary>
 20        public const BindingFlags PrivateFieldFlags = BindingFlags.Instance | BindingFlags.NonPublic;
 21
 22        /// <summary>
 23        ///     <see cref="BindingFlags" /> for a private static.
 24        /// </summary>
 25        public const BindingFlags PrivateStaticFlags = BindingFlags.Static | BindingFlags.NonPublic;
 26
 27        /// <summary>
 28        ///     <see cref="BindingFlags" /> for a public static.
 29        /// </summary>
 30        public const BindingFlags PublicStaticFlags = BindingFlags.Static | BindingFlags.Public;
 31
 32        /// <summary>
 33        ///     The assembly qualified name for <see cref="UnityEngine.Object" />
 34        /// </summary>
 235        public static readonly string UnityObjectName = typeof(Object).AssemblyQualifiedName;
 36
 37        /// <summary>
 38        ///     The assembly qualified name for <see cref="Serializable.SerializableTypes" />
 39        /// </summary>
 240        public static readonly string SerializedTypesName =
 41            typeof(Serializable.SerializableTypes).AssemblyQualifiedName;