< 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:17
Uncovered lines:0
Coverable lines:17
Total lines:98
Line coverage:100% (17 of 17)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GetFontSize(...)0%220100%
GetTextAlign(...)0%220100%
GetWidth(...)0%220100%
GetHeight(...)0%220100%
GetShadowColor(...)0%220100%
GetOutlineColor(...)0%220100%
GetTextColor(...)0%220100%
GetTextWrapping(...)0%220100%
GetLineCount(...)0%220100%
GetFontAutoSize(...)0%220100%
GetPadding(...)0%990100%
GetLineSpacing(...)0%220100%
GetFont(...)0%220100%
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 Decentraland.Common;
 2using UnityEngine;
 3
 4namespace DCL.ECSComponents
 5{
 6    public static class PBTextShape_Defaults
 7    {
 8        public static float GetFontSize(this PBTextShape self)
 9        {
 2110            return self.HasFontSize ? self.FontSize : 10.0f;
 11        }
 12
 13        public static TextAlignMode GetTextAlign(this PBTextShape self)
 14        {
 2115            return self.HasTextAlign ? self.TextAlign : TextAlignMode.TamMiddleCenter;
 16        }
 17
 18        public static float GetWidth(this PBTextShape self)
 19        {
 420            return self.HasWidth ? self.Width : 1.0f;
 21        }
 22
 23        public static float GetHeight(this PBTextShape self)
 24        {
 425            return self.HasHeight ? self.Height : 1.0f;
 26        }
 27
 28        public static Color3 GetShadowColor(this PBTextShape self)
 29        {
 2030            return self.ShadowColor ?? new Color3() { R = 1.0f, G = 1.0f, B = 1.0f };
 31        }
 32
 33        public static Color3 GetOutlineColor(this PBTextShape self)
 34        {
 2035            return self.OutlineColor ?? new Color3() { R = 1.0f, G = 1.0f, B = 1.0f };
 36        }
 37
 38        public static Color4 GetTextColor(this PBTextShape self)
 39        {
 2140            return self.TextColor ?? new Color4() { R = 1.0f, G = 1.0f, B = 1.0f, A = 1.0f};
 41        }
 42
 43        public static bool GetTextWrapping(this PBTextShape self)
 44        {
 4245            return self.HasTextWrapping && self.TextWrapping;
 46        }
 47
 48        public static int GetLineCount(this PBTextShape self)
 49        {
 2250            return self.HasLineCount ? self.LineCount : 0;
 51        }
 52
 53        public static bool GetFontAutoSize(this PBTextShape self)
 54        {
 2555            return self.HasFontAutoSize && self.FontAutoSize;
 56        }
 57
 58        public static Vector4 GetPadding(this PBTextShape self)
 59        {
 2160            return new Vector4(
 61                x: self.HasPaddingLeft ? self.PaddingLeft : 0,
 62                y: self.HasPaddingTop ? self.PaddingTop : 0,
 63                z: self.HasPaddingRight ? self.PaddingRight : 0,
 64                w: self.HasPaddingBottom ? self.PaddingBottom : 0
 65            );
 66        }
 67
 68        public static float GetLineSpacing(this PBTextShape self)
 69        {
 2170            return self.HasLineSpacing ? self.LineSpacing : 0;
 71        }
 72
 73        public static Font GetFont(this PBTextShape self)
 74        {
 2175            return self.HasFont ? self.Font : Font.FSansSerif;
 76        }
 77
 78        public static float GetShadowOffsetX(this PBTextShape self)
 79        {
 2080            return self.HasShadowOffsetX ? self.ShadowOffsetX : 0;
 81        }
 82
 83        public static float GetShadowOffsetY(this PBTextShape self)
 84        {
 2085            return self.HasShadowOffsetY ? self.ShadowOffsetY : 0;
 86        }
 87
 88        public static float GetShadowBlur(this PBTextShape self)
 89        {
 2090            return self.HasShadowBlur ? self.ShadowBlur : 0;
 91        }
 92
 93        public static float GetOutlineWidth(this PBTextShape self)
 94        {
 2095            return self.HasOutlineWidth ? self.OutlineWidth : 0;
 96        }
 97    }
 98}