< Summary

Line coverage
100%
Covered lines: 30
Uncovered lines: 0
Coverable lines: 30
Total lines: 124
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
File 1: GetViewHashCode()0%110100%
File 2: ScriptableValue()0%110100%
File 3: ScriptableValue()0%110100%

File(s)

./Packages/se.hertzole.scriptable-values/Runtime/Values/ScriptableValue.Bindings.cs

#LineLine coverage
 1#if SCRIPTABLE_VALUES_RUNTIME_BINDING && SCRIPTABLE_VALUES_UITOOLKIT
 2namespace Hertzole.ScriptableValues
 3{
 4    partial class ScriptableValue
 5    {
 6        /// <inheritdoc />
 7        protected override long GetViewHashCode()
 12968        {
 9            unchecked
 129610            {
 129611                long hash = 17;
 129612                hash = hash * 23 + base.GetViewHashCode();
 129613                hash = hash * 23 + isReadOnly.GetHashCode();
 129614                hash = hash * 23 + resetValueOnStart.GetHashCode();
 129615                hash = hash * 23 + setEqualityCheck.GetHashCode();
 129616                return hash;
 17            }
 129618        }
 19    }
 20}
 21#endif

./Packages/se.hertzole.scriptable-values/Runtime/Values/ScriptableValue.cs

#LineLine coverage
 1using UnityEngine;
 2#if SCRIPTABLE_VALUES_PROPERTIES
 3using Unity.Properties;
 4#endif
 5
 6namespace Hertzole.ScriptableValues
 7{
 8    /// <summary>
 9    ///     Base class for all <see cref="ScriptableValue{TValue}" />.
 10    /// </summary>
 11    /// <remarks>You should probably inherit from <see cref="ScriptableList{T}" /> instead.</remarks>
 12#if UNITY_EDITOR
 13    [HelpURL(Documentation.SCRIPTABLE_VALUE_URL)]
 14#endif
 15    public abstract partial class ScriptableValue : RuntimeScriptableObject, ICanBeReadOnly
 16    {
 17        [SerializeField]
 18        [EditorTooltip("If read only, the value cannot be changed at runtime.")]
 19#if SCRIPTABLE_VALUES_PROPERTIES
 20        [DontCreateProperty]
 21#endif
 1512322        internal bool isReadOnly = false;
 23        [SerializeField]
 24        [EditorTooltip("If true, the value will be reset to the default value on play mode start/game boot.")]
 25#if SCRIPTABLE_VALUES_PROPERTIES
 26        [DontCreateProperty]
 27#endif
 1512328        internal bool resetValueOnStart = true;
 29        [SerializeField]
 30        [EditorTooltip("If true, an equality check will be run before setting the value to make sure the new value is no
 31#if SCRIPTABLE_VALUES_PROPERTIES
 32        [DontCreateProperty]
 33#endif
 1512334        internal bool setEqualityCheck = true;
 35
 36        /// <summary>
 37        ///     If read only, the value cannot be changed at runtime.
 38        /// </summary>
 39#if SCRIPTABLE_VALUES_PROPERTIES
 40        [CreateProperty]
 41#endif
 42        public bool IsReadOnly
 43        {
 11528144            get { return isReadOnly; }
 834345            set { SetField(ref isReadOnly, value, isReadOnlyChangingArgs, isReadOnlyChangedArgs); }
 46        }
 47        /// <summary>
 48        ///     If <c>true</c>, the value will be reset to the default value on play mode start/game boot.
 49        /// </summary>
 50#if SCRIPTABLE_VALUES_PROPERTIES
 51        [CreateProperty]
 52#endif
 53        public bool ResetValueOnStart
 54        {
 5126455            get { return resetValueOnStart; }
 1512956            set { SetField(ref resetValueOnStart, value, resetValueOnStartChangingArgs, resetValueOnStartChangedArgs); }
 57        }
 58        /// <summary>
 59        ///     If <c>true</c>, an equality check will be run before setting the value to make sure the new value is not
 60        ///     as the
 61        ///     old one.
 62        /// </summary>
 63#if SCRIPTABLE_VALUES_PROPERTIES
 64        [CreateProperty]
 65#endif
 66        public bool SetEqualityCheck
 67        {
 7713068            get { return setEqualityCheck; }
 1723569            set { SetField(ref setEqualityCheck, value, setEqualityCheckChangingArgs, setEqualityCheckChangedArgs); }
 70        }
 71
 72#if UNITY_EDITOR
 73        // Used for the CreateAssetMenu attribute order.
 74        internal const int ORDER = -1000;
 75#endif
 76    }
 77}

./Packages/se.hertzole.scriptable-values/Runtime/Values/ScriptableValue.EventArgs.cs

#LineLine coverage
 1using System.ComponentModel;
 2
 3namespace Hertzole.ScriptableValues
 4{
 5    partial class ScriptableValue
 6    {
 67        public static readonly PropertyChangingEventArgs isReadOnlyChangingArgs = new PropertyChangingEventArgs(nameof(I
 68        public static readonly PropertyChangedEventArgs isReadOnlyChangedArgs = new PropertyChangedEventArgs(nameof(IsRe
 9
 610        public static readonly PropertyChangingEventArgs resetValueOnStartChangingArgs = new PropertyChangingEventArgs(n
 611        public static readonly PropertyChangedEventArgs resetValueOnStartChangedArgs = new PropertyChangedEventArgs(name
 12
 613        public static readonly PropertyChangingEventArgs setEqualityCheckChangingArgs = new PropertyChangingEventArgs(na
 614        public static readonly PropertyChangedEventArgs setEqualityCheckChangedArgs = new PropertyChangedEventArgs(nameo
 15
 616        public static readonly PropertyChangingEventArgs valueChangingArgs = new PropertyChangingEventArgs(nameof(Script
 617        public static readonly PropertyChangedEventArgs valueChangedArgs = new PropertyChangedEventArgs(nameof(Scriptabl
 18
 619        public static readonly PropertyChangingEventArgs previousValueChangingArgs =
 20            new PropertyChangingEventArgs(nameof(ScriptableValue<object>.PreviousValue));
 621        public static readonly PropertyChangedEventArgs previousValueChangedArgs = new PropertyChangedEventArgs(nameof(S
 22
 623        public static readonly PropertyChangingEventArgs defaultValueChangingArgs = new PropertyChangingEventArgs(nameof
 624        public static readonly PropertyChangedEventArgs defaultValueChangedArgs = new PropertyChangedEventArgs(nameof(Sc
 25    }
 26}