< Summary

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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
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    public string asset_pack_id;
 23    public string name;
 24    public string model;
 25    public string thumbnail;
 26    public List<string> tags;
 27
 28    public string category;
 29    public string titleToShow;
 30    public Dictionary<string, string> contents;
 31
 32    public string created_at;
 33    public string updated_at;
 34
 35    public ObjectMetrics metrics;
 36    public SmartItemParameter[] parameters;
 37    public SmartItemAction[] actions;
 38    public string script;
 39    public bool isFavorite = false;
 40
 41    public string GetComposedThumbnailUrl()
 42    {
 43        //NOTE: This is a workaround since the builder sometimes send the thumbnail composed and sometimes it doesn't
 44        //This way we ensure that the base url is only 1 time
 7845        string urlBase = BIWUrlUtils.GetUrlSceneObjectContent();
 7846        if (thumbnail != null)
 7547            urlBase = urlBase + thumbnail.Replace(urlBase, "");
 7848        return urlBase;
 49    }
 50
 051    public string GetBaseURL() { return BIWUrlUtils.GetUrlSceneObjectContent(); }
 52
 053    public bool IsSmartItem() { return !string.IsNullOrEmpty(script); }
 54}