< Summary

Class:CollapsableSortedFriendEntryList
Assembly:FriendsHUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/FriendsHUD/Scripts/Tabs/CollapsableSortedFriendEntryList.cs
Covered lines:0
Uncovered lines:6
Coverable lines:6
Total lines:19
Line coverage:0% (0 of 6)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Filter(...)0%6200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/FriendsHUD/Scripts/Tabs/CollapsableSortedFriendEntryList.cs

#LineLine coverage
 1using System.Text.RegularExpressions;
 2using UIComponents.CollapsableSortedList;
 3
 4public class CollapsableSortedFriendEntryList : CollapsableSortedListComponentView<string, FriendEntryBase>
 5{
 6    public void Filter(string search)
 7    {
 08        if (!gameObject.activeInHierarchy) return;
 09        var regex = new Regex(search, RegexOptions.IgnoreCase);
 010        Filter(entry =>
 11        {
 012            if (regex.IsMatch(entry.Model.userId)) return true;
 013            return !string.IsNullOrEmpty(entry.Model.userName) && regex.IsMatch(entry.Model.userName);
 14        });
 15        // throttling may intruduce race conditions & artifacts into the ui
 16        // StartCoroutine(FilterAsync(entry => regex.IsMatch(entry.model.userId)
 17        //     || regex.IsMatch(entry.model.userName)));
 018    }
 19}

Methods/Properties

Filter(System.String)