< Summary

Class:SceneObject
Assembly:SceneObject
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Models/SceneAssets/SceneObject/SceneObject.cs
Covered lines:5
Uncovered lines:2
Coverable lines:7
Total lines:57
Line coverage:71.4% (5 of 7)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SceneObject()0%110100%
GetComposedThumbnailUrl()0%220100%
GetBaseURL()0%2100%
IsSmartItem()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Models/SceneAssets/SceneObject/SceneObject.cs

#LineLine coverage
 1using DCL.Components;
 2using DCL.Configuration;
 3using System.Collections;
 4using System.Collections.Generic;
 5using UnityEngine;
 6
 7[System.Serializable]
 8public class SceneObject
 9{
 10    [System.Serializable]
 11    public class ObjectMetrics
 12    {
 13        public int meshes;
 14        public int bodies;
 15        public int materials;
 16        public int textures;
 17        public int triangles;
 18        public int entities;
 19    }
 20
 21    public string id;
 22
 23    // This legacyId is not used for anything, but it is needed for the current builder, we can safely delete it when th
 4024    public string legacyId = "";
 25    public string asset_pack_id;
 26    public string name;
 27    public string model;
 28    public string thumbnail;
 29    public List<string> tags;
 30
 31    public string category;
 32    public string titleToShow;
 33    public Dictionary<string, string> contents;
 34
 35    public string created_at;
 36    public string updated_at;
 37
 38    public ObjectMetrics metrics;
 39    public SmartItemParameter[] parameters;
 40    public SmartItemAction[] actions;
 41    public string script;
 42    public bool isFavorite = false;
 43
 44    public string GetComposedThumbnailUrl()
 45    {
 46        //NOTE: This is a workaround since the builder sometimes send the thumbnail composed and sometimes it doesn't
 47        //This way we ensure that the base url is only 1 time
 7848        string urlBase = BIWUrlUtils.GetUrlSceneObjectContent();
 7849        if (thumbnail != null)
 7550            urlBase = urlBase + thumbnail.Replace(urlBase, "");
 7851        return urlBase;
 52    }
 53
 054    public string GetBaseURL() { return BIWUrlUtils.GetUrlSceneObjectContent(); }
 55
 056    public bool IsSmartItem() { return !string.IsNullOrEmpty(script); }
 57}