< Summary

Class:DCL.Helpers.PlayerPrefsUtils
Assembly:Utils
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Helpers/Utils/PlayerPrefsUtils.cs
Covered lines:10
Uncovered lines:7
Coverable lines:17
Total lines:41
Line coverage:58.8% (10 of 17)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GetInt(...)0%2100%
GetInt(...)0%110100%
SetInt(...)0%1.121050%
HasKey(...)0%110100%
GetString(...)0%330100%
SetString(...)0%1.121050%
Save()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Helpers/Utils/PlayerPrefsUtils.cs

#LineLine coverage
 1using UnityEngine;
 2
 3namespace DCL.Helpers
 4{
 5    public static class PlayerPrefsUtils
 6    {
 07        public static int GetInt(string key) { return PlayerPrefs.GetInt(key); }
 8
 1249        public static int GetInt(string key, int defaultValue) { return PlayerPrefs.GetInt(key, defaultValue); }
 10
 11        public static void SetInt(string key, int value)
 12        {
 13            try
 14            {
 1815                PlayerPrefs.SetInt(key, value);
 1816            }
 017            catch (PlayerPrefsException e)
 18            {
 019                Debug.Log("There was an issue setting PlayerPrefs int!");
 020            }
 1821        }
 22
 323        public static bool HasKey(string key) { return PlayerPrefs.HasKey(key); }
 24
 1025        public static string GetString(string key, string defaultValue = null) { return PlayerPrefs.GetString(key, strin
 26
 27        public static void SetString(string key, string value)
 28        {
 29            try
 30            {
 2031                PlayerPrefs.SetString(key, value);
 2032            }
 033            catch (PlayerPrefsException e)
 34            {
 035                Debug.Log("There was an issue setting PlayerPrefs string!");
 036            }
 2037        }
 38
 7239        public static void Save() { PlayerPrefs.Save(); }
 40    }
 41}