< Summary

Class:QuestsUIAnalytics
Assembly:QuestsUIAnalytics
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Analytics/QuestsUIAnalytics/QuestsUIAnalytics.cs
Covered lines:0
Uncovered lines:23
Coverable lines:23
Total lines:56
Line coverage:0% (0 of 23)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SendQuestPinChanged(...)0%2100%
SendJumpInPressed(...)0%2100%
SendQuestLogVisibiltyChanged(...)0%12300%

File(s)

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

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3
 4public static class QuestsUIAnalytics
 5{
 6    private const string QUEST_PIN_CHANGED = "quest_pin_changed";
 7    private const string QUEST_JUMP_IN_PRESSED = "quest_jump_in_pressed";
 8    private const string QUEST_LOG_VISIBILITY_CHANGED = "quest_log_visibility_changed";
 9
 10    private static DateTime? questLogSetVisibleTimeStamp = null;
 11
 12    public enum UIContext
 13    {
 14        QuestsLog,
 15        QuestDetails,
 16        QuestsTracker,
 17    }
 18
 19    public static void SendQuestPinChanged(string questId, bool isPinned, UIContext uiContext)
 20    {
 021        Dictionary<string, string> data = new Dictionary<string, string>();
 022        data.Add("quest_id", questId);
 023        data.Add("quest_ui_context", uiContext.ToString());
 024        data.Add("quest_is_pinned", isPinned.ToString());
 025        GenericAnalytics.SendAnalytic(QUEST_PIN_CHANGED, data);
 026    }
 27
 28    public static void SendJumpInPressed(string questId, string taskId, string coordinates, UIContext uiContext)
 29    {
 030        Dictionary<string, string> data = new Dictionary<string, string>();
 031        data.Add("quest_id", questId);
 032        data.Add("task_id", taskId);
 033        data.Add("jump_in_coordinates", coordinates);
 034        data.Add("quest_ui_context", uiContext.ToString());
 035        GenericAnalytics.SendAnalytic(QUEST_JUMP_IN_PRESSED, data);
 036    }
 37
 38    public static void SendQuestLogVisibiltyChanged(bool isVisible, string triggerContext)
 39    {
 040        Dictionary<string, string> data = new Dictionary<string, string>();
 041        data.Add("quests_log_visible", isVisible.ToString());
 042        data.Add("trigger_context", triggerContext);
 043        if (isVisible)
 044            questLogSetVisibleTimeStamp = DateTime.Now;
 45        else
 46        {
 047            if (questLogSetVisibleTimeStamp.HasValue)
 48            {
 049                data.Add("open_duration_ms", (DateTime.Now - questLogSetVisibleTimeStamp.Value).TotalMilliseconds.ToStri
 050                questLogSetVisibleTimeStamp = null;
 51            }
 52        }
 53
 054        GenericAnalytics.SendAnalytic(QUEST_LOG_VISIBILITY_CHANGED, data);
 055    }
 56}