< Summary

Class:DCL.ECSComponents.Utils.ECSAvatarUtils
Assembly:ECSComponents.Utils
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/Utils/ECSAvatarUtils.cs
Covered lines:4
Uncovered lines:5
Coverable lines:9
Total lines:32
Line coverage:44.4% (4 of 9)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
DetectAvatars(...)0%11.445036.36%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/Utils/ECSAvatarUtils.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using UnityEngine;
 3
 4namespace DCL.ECSComponents.Utils
 5{
 6    public static class ECSAvatarUtils
 7    {
 8        internal const string AVATAR_TRIGGER_LAYER = "AvatarTriggerDetection";
 9
 10        public static HashSet<GameObject> DetectAvatars(in UnityEngine.Vector3 box, in UnityEngine.Vector3 center, in Qu
 11        {
 512            HashSet<GameObject> result = new HashSet<GameObject>();
 13
 514            Collider[] colliders = Physics.OverlapBox(center, box * 0.5f, rotation,
 15                LayerMask.GetMask(AVATAR_TRIGGER_LAYER), QueryTriggerInteraction.Collide);
 16
 517            if (colliders.Length == 0)
 518                return result;
 19
 020            bool hasExcludeList = excludeColliders != null;
 21
 022            foreach (Collider collider in colliders)
 23            {
 024                if (hasExcludeList && excludeColliders.Contains(collider))
 25                    continue;
 26
 027                result.Add(collider.transform.parent.gameObject);
 28            }
 029            return result;
 30        }
 31    }
 32}