< Summary

Class:FeatureFlagController
Assembly:FeatureFlag
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/FeatureFlags/FeatureFlagController.cs
Covered lines:18
Uncovered lines:2
Coverable lines:20
Total lines:46
Line coverage:90% (18 of 20)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
FeatureFlagController(...)0%440100%
AddBridgeComponent(...)0%3.333066.67%
Dispose()0%110100%
Initialize()0%110100%

File(s)

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

#LineLine coverage
 1using DCL;
 2using UnityEngine;
 3
 4public class FeatureFlagController : IFeatureFlagController
 5{
 6    internal FeatureFlagBridge featureFlagBridgeComponent;
 7    internal GameObject bridgeGameObject;
 8
 6309    public FeatureFlagController(GameObject bridgeGameObject = null)
 10    {
 63011        if ( bridgeGameObject == null )
 12        {
 62913            if (SceneReferences.i != null)
 62914                bridgeGameObject = SceneReferences.i.bridgeGameObject;
 15        }
 16
 63017        this.bridgeGameObject = bridgeGameObject;
 18
 63019        if (bridgeGameObject == null)
 57720            return;
 21
 5322        AddBridgeComponent(bridgeGameObject);
 5323    }
 24
 25    public void AddBridgeComponent(GameObject gameObjectToAddBridge)
 26    {
 5327        if (gameObjectToAddBridge == null)
 028            return;
 29
 5330        if (featureFlagBridgeComponent != null)
 031            Dispose();
 32
 5333        featureFlagBridgeComponent = gameObjectToAddBridge.AddComponent<FeatureFlagBridge>();
 5334    }
 35
 36    public void Dispose()
 37    {
 63038        Object.Destroy(bridgeGameObject);
 63039        bridgeGameObject = null;
 63040        featureFlagBridgeComponent = null;
 63041    }
 42
 43    public void Initialize()
 44    {
 62945    }
 46}