< Summary

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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GetDataFromJSON(...)0%2100%
GetClassIdFromType()0%5.25080%
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            {
 4823                switch (type)
 24                {
 25                    case OnPointerDown.NAME:
 1926                        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                }
 32
 033                return CLASS_ID_COMPONENT.UUID_CALLBACK;
 34            }
 35        }
 36
 37        public override IEnumerator ApplyChanges(BaseModel newModel)
 38        {
 039            this.model = newModel ?? new UUIDComponent.Model();
 040            return null;
 41        }
 42
 043        public override int GetClassId() { return (int) CLASS_ID_COMPONENT.UUID_CALLBACK; }
 44    }
 45}