< Summary

Class:DCL.ECSComponents.PBTextShape_Defaults
Assembly:DCL.ECSComponents.Defaults
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/Defaults/PBTextShape_Defaults.cs
Covered lines:14
Uncovered lines:3
Coverable lines:17
Total lines:97
Line coverage:82.3% (14 of 17)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GetFontSize(...)0%220100%
GetTextAlign(...)0%6200%
GetWidth(...)0%220100%
GetHeight(...)0%220100%
GetShadowColor(...)0%220100%
GetOutlineColor(...)0%220100%
GetTextColor(...)0%220100%
GetTextWrapping(...)0%220100%
GetLineCount(...)0%220100%
GetFontAutoSize(...)0%6200%
GetPadding(...)0%990100%
GetLineSpacing(...)0%220100%
GetFont(...)0%6200%
GetShadowOffsetX(...)0%220100%
GetShadowOffsetY(...)0%220100%
GetShadowBlur(...)0%220100%
GetOutlineWidth(...)0%220100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/Defaults/PBTextShape_Defaults.cs

#LineLine coverage
 1using UnityEngine;
 2
 3namespace DCL.ECSComponents
 4{
 5    public static class PBTextShape_Defaults
 6    {
 7        public static float GetFontSize(this PBTextShape self)
 8        {
 229            return self.HasFontSize ? self.FontSize : 10.0f;
 10        }
 11
 12        public static TextAlignMode GetTextAlign(this PBTextShape self)
 13        {
 014            return self.HasTextAlign ? self.TextAlign : TextAlignMode.TamMiddleCenter;
 15        }
 16
 17        public static float GetWidth(this PBTextShape self)
 18        {
 419            return self.HasWidth ? self.Width : 1.0f;
 20        }
 21
 22        public static float GetHeight(this PBTextShape self)
 23        {
 424            return self.HasHeight ? self.Height : 1.0f;
 25        }
 26
 27        public static Color3 GetShadowColor(this PBTextShape self)
 28        {
 329            return self.ShadowColor ?? new Color3() { R = 1.0f, G = 1.0f, B = 1.0f };
 30        }
 31
 32        public static Color3 GetOutlineColor(this PBTextShape self)
 33        {
 334            return self.OutlineColor ?? new Color3() { R = 1.0f, G = 1.0f, B = 1.0f };
 35        }
 36
 37        public static Color4 GetTextColor(this PBTextShape self)
 38        {
 2239            return self.TextColor ?? new Color4() { R = 1.0f, G = 1.0f, B = 1.0f, A = 1.0f};
 40        }
 41
 42        public static bool GetTextWrapping(this PBTextShape self)
 43        {
 4444            return self.HasTextWrapping && self.TextWrapping;
 45        }
 46
 47        public static int GetLineCount(this PBTextShape self)
 48        {
 2349            return self.HasLineCount ? self.LineCount : 0;
 50        }
 51
 52        public static bool GetFontAutoSize(this PBTextShape self)
 53        {
 054            return self.HasFontAutoSize && self.FontAutoSize;
 55        }
 56
 57        public static Vector4 GetPadding(this PBTextShape self)
 58        {
 2259            return new Vector4(
 60                x: self.HasPaddingLeft ? self.PaddingLeft : 0,
 61                y: self.HasPaddingTop ? self.PaddingTop : 0,
 62                z: self.HasPaddingRight ? self.PaddingRight : 0,
 63                w: self.HasPaddingBottom ? self.PaddingBottom : 0
 64            );
 65        }
 66
 67        public static float GetLineSpacing(this PBTextShape self)
 68        {
 2269            return self.HasLineSpacing ? self.LineSpacing : 0;
 70        }
 71
 72        public static Font GetFont(this PBTextShape self)
 73        {
 074            return self.HasFont ? self.Font : Font.FSansSerif;
 75        }
 76
 77        public static float GetShadowOffsetX(this PBTextShape self)
 78        {
 379            return self.HasShadowOffsetX ? self.ShadowOffsetX : 0;
 80        }
 81
 82        public static float GetShadowOffsetY(this PBTextShape self)
 83        {
 384            return self.HasShadowOffsetY ? self.ShadowOffsetY : 0;
 85        }
 86
 87        public static float GetShadowBlur(this PBTextShape self)
 88        {
 389            return self.HasShadowBlur ? self.ShadowBlur : 0;
 90        }
 91
 92        public static float GetOutlineWidth(this PBTextShape self)
 93        {
 394            return self.HasOutlineWidth ? self.OutlineWidth : 0;
 95        }
 96    }
 97}