< Summary

Class:DCL.DataStore_Channels
Assembly:DataStore
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/DataStore/DataStore_Channels.cs
Covered lines:17
Uncovered lines:0
Coverable lines:17
Total lines:31
Line coverage:100% (17 of 17)
Covered branches:0
Total branches:0
Covered methods:2
Total methods:2
Method coverage:100% (2 of 2)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
DataStore_Channels()0%110100%
SetAvailableMemberInChannel(...)0%4.034087.5%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/DataStore/DataStore_Channels.cs

#LineLine coverage
 1using System.Collections.Generic;
 2
 3namespace DCL
 4{
 5    public class DataStore_Channels
 6    {
 167        public readonly BaseVariable<string> currentJoinChannelModal = new BaseVariable<string>(null);
 168        public readonly BaseVariable<ChannelJoinedSource> channelJoinedSource = new BaseVariable<ChannelJoinedSource>(Ch
 169        public readonly BaseVariable<ChannelLeaveSource> channelLeaveSource = new BaseVariable<ChannelLeaveSource>(Chann
 1610        public readonly BaseVariable<bool> isCreationModalVisible = new BaseVariable<bool>();
 1611        public readonly BaseVariable<string> currentChannelLimitReached = new BaseVariable<string>();
 1612        public readonly BaseVariable<string> joinChannelError = new BaseVariable<string>();
 1613        public readonly BaseVariable<string> leaveChannelError = new BaseVariable<string>();
 1614        public readonly BaseVariable<string> channelToBeOpened = new BaseVariable<string>();
 1615        public readonly BaseVariable<bool> isPromoteToastVisible = new BaseVariable<bool>();
 1616        public readonly BaseDictionary<string, HashSet<string>> availableMembersByChannel = new ();
 17
 18        public void SetAvailableMemberInChannel(string userId, string channelId)
 19        {
 420            if (string.IsNullOrEmpty(userId)) return;
 21
 422            if (!availableMembersByChannel.ContainsKey(channelId))
 223                availableMembersByChannel.Add(channelId, new HashSet<string>());
 24
 425            HashSet<string> availableMembers = availableMembersByChannel[channelId];
 26
 427            if (!availableMembers.Contains(userId))
 328                availableMembers.Add(userId);
 429        }
 30    }
 31}