< Summary

Class:DCL.UUIDComponent
Assembly:MainScripts
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/UUIDComponent/UUIDComponent.cs
Covered lines:6
Uncovered lines:5
Coverable lines:11
Total lines:49
Line coverage:54.5% (6 of 11)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GetDataFromJSON(...)0%2100%
GetClassIdFromType()0%7.147085.71%
ApplyChanges(...)0%6200%
GetClassId()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/UUIDComponent/UUIDComponent.cs

#LineLine coverage
 1using DCL.Components;
 2using DCL.Controllers;
 3using DCL.Helpers;
 4using DCL.Models;
 5using System.Collections;
 6using System.Collections.Generic;
 7using UnityEngine;
 8
 9namespace DCL
 10{
 11    public class UUIDComponent : BaseComponent
 12    {
 13        [System.Serializable]
 14        public class Model : BaseModel
 15        {
 16            public string type;
 17            public string uuid;
 18
 019            public override BaseModel GetDataFromJSON(string json) { return Utils.SafeFromJson<Model>(json); }
 20
 21            public CLASS_ID_COMPONENT GetClassIdFromType()
 22            {
 6923                switch (type)
 24                {
 25                    case OnPointerDown.NAME:
 2126                        return CLASS_ID_COMPONENT.UUID_ON_DOWN;
 27                    case OnPointerUp.NAME:
 828                        return CLASS_ID_COMPONENT.UUID_ON_UP;
 29                    case OnClick.NAME:
 2130                        return CLASS_ID_COMPONENT.UUID_ON_CLICK;
 31                    case OnPointerHoverEnter.NAME:
 1332                        return CLASS_ID_COMPONENT.UUID_ON_HOVER_ENTER;
 33                    case OnPointerHoverExit.NAME:
 634                        return CLASS_ID_COMPONENT.UUID_ON_HOVER_EXIT;
 35                }
 36
 037                return CLASS_ID_COMPONENT.UUID_CALLBACK;
 38            }
 39        }
 40
 41        public override IEnumerator ApplyChanges(BaseModel newModel)
 42        {
 043            this.model = newModel ?? new UUIDComponent.Model();
 044            return null;
 45        }
 46
 047        public override int GetClassId() { return (int) CLASS_ID_COMPONENT.UUID_CALLBACK; }
 48    }
 49}