< 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:3
Uncovered lines:6
Coverable lines:9
Total lines:30
Line coverage:33.3% (3 of 9)
Covered branches:0
Total branches:0

Metrics

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

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            Collider[] colliders = Physics.OverlapBox(center, box * 0.5f, rotation,
 13                LayerMask.GetMask(AVATAR_TRIGGER_LAYER), QueryTriggerInteraction.Collide);
 14
 515            if (colliders.Length == 0)
 516                return null;
 17
 018            bool hasExcludeList = excludeColliders != null;
 019            HashSet<GameObject> result = new HashSet<GameObject>();
 020            foreach (Collider collider in colliders)
 21            {
 022                if (hasExcludeList && excludeColliders.Contains(collider))
 23                    continue;
 24
 025                result.Add(collider.transform.parent.gameObject);
 26            }
 027            return result;
 28        }
 29    }
 30}