< Summary

Class:Analytics
Assembly:Analytics
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/ServiceProviders/Analytics/Analytics.cs
Covered lines:6
Uncovered lines:1
Coverable lines:7
Total lines:28
Line coverage:85.7% (6 of 7)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Analytics()0%110100%
SendAnalytic(...)0%2.062075%
SendToSegment(...)0%220100%
Dispose()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/ServiceProviders/Analytics/Analytics.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using System.Linq;
 3using DCL.Interface;
 4using Newtonsoft.Json;
 5
 6/// <summary>
 7/// For the events we use the convention of all lower cases and "_" instead of space
 8/// </summary>
 9public class Analytics : IAnalytics
 10{
 11    private static bool VERBOSE = false;
 12
 13    //Remove this once environment is on its own assembly and can be accessed properly
 14    public static IAnalytics i;
 201315    public Analytics() { i = this; }
 16
 17    public void SendAnalytic(string eventName, Dictionary<string, string> data)
 18    {
 6019        if (VERBOSE)
 020            UnityEngine.Debug.Log($"{eventName}:\n{JsonConvert.SerializeObject(data, Formatting.Indented)}");
 21
 6022        SendToSegment(eventName, data);
 6023    }
 24
 32925    internal void SendToSegment(string eventName, Dictionary<string, string> data) { WebInterface.ReportAnalyticsEvent(e
 26
 69227    public void Dispose() { }
 28}