< Summary

Class:DCL.PluginInfo
Assembly:PluginSystem
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/PluginSystem/PluginInfo.cs
Covered lines:11
Uncovered lines:3
Coverable lines:14
Total lines:39
Line coverage:78.5% (11 of 14)
Covered branches:0
Total branches:0
Covered methods:3
Total methods:3
Method coverage:100% (3 of 3)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Enable()0%2.212062.5%
Disable()0%220100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/PluginSystem/PluginInfo.cs

#LineLine coverage
 1using System;
 2using UnityEngine;
 3
 4namespace DCL
 5{
 6    public class PluginInfo
 7    {
 358        public bool isEnabled => instance != null;
 9        public string flag;
 10        public PluginBuilder builder;
 11        public IPlugin instance;
 12        public bool enableOnInit = false;
 13
 14        public void Enable()
 15        {
 1016            if ( isEnabled )
 017                return;
 18
 19            try
 20            {
 1021                instance = builder.Invoke();
 1022                enableOnInit = false;
 1023            }
 24            catch (Exception e)
 25            {
 026                Debug.LogException(e);
 027            }
 1028        }
 29
 30        public void Disable()
 31        {
 1132            if ( !isEnabled )
 133                return;
 34
 1035            instance.Dispose();
 1036            instance = null;
 1037        }
 38    }
 39}

Methods/Properties

isEnabled()
Enable()
Disable()