< Summary

Class:FeatureFlag
Assembly:FeatureFlagData
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/FeatureFlags/Data/FeatureFlag.cs
Covered lines:5
Uncovered lines:4
Coverable lines:9
Total lines:45
Line coverage:55.5% (5 of 9)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
FeatureFlag()0%110100%
IsFeatureEnabled(...)0%220100%
ToString()0%6200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/FeatureFlags/Data/FeatureFlag.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using System.Linq;
 4using UnityEngine;
 5
 6public class FeatureFlag
 7{
 8    public const string GPU_ONLY_MESHES = "use-gpu-only-meshes";
 9
 64210    public readonly Dictionary<string, bool> flags  = new Dictionary<string, bool>();
 64211    public readonly Dictionary<string, FeatureFlagVariant> variants  = new Dictionary<string, FeatureFlagVariant>();
 12
 13    public bool IsFeatureEnabled(string featureName)
 14    {
 23315        if (flags.ContainsKey(featureName))
 616            return flags[featureName];
 17
 22718        return false;
 19    }
 20
 21    public string ToString()
 22    {
 023        string result = "";
 24
 025        foreach ( var flag in flags )
 26        {
 027            result += $"{flag.Key}: {flag.Value}\n";
 28        }
 29
 030        return result;
 31    }
 32}
 33
 34public class FeatureFlagVariant
 35{
 36    private string name;
 37    private bool enable;
 38    private Payload payload;
 39
 40    struct Payload
 41    {
 42        private string type;
 43        private string value;
 44    }
 45}