< Summary

Class:DCL.FPSDisplay.FPSColoring
Assembly:FPSDisplay
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/Debugging/FPSDisplay/FPSColoring.cs
Covered lines:0
Uncovered lines:5
Coverable lines:5
Total lines:29
Line coverage:0% (0 of 5)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
FPSColoring()0%2100%
GetDisplayColor(...)0%12300%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/Debugging/FPSDisplay/FPSColoring.cs

#LineLine coverage
 1using UnityEngine;
 2
 3namespace DCL.FPSDisplay
 4{
 5    public class FPSColoring
 6    {
 07        public static FPSColor[] coloring =
 8        {
 9            new FPSColor(Color.green, FPSEvaluation.GREAT),
 10            new FPSColor(Color.white, FPSEvaluation.GOOD),
 11            new FPSColor(Color.yellow, FPSEvaluation.BAD),
 12            new FPSColor(new Color(0.9764706f, 0.4117647f, 0.05490196f), FPSEvaluation.WORSE),
 13            new FPSColor(Color.red, FPSEvaluation.UNBEARABLE),
 14        };
 15
 16        public static Color GetDisplayColor(float fps)
 17        {
 018            for (int i = 0; i < coloring.Length; i++)
 19            {
 020                if (fps >= coloring[i].fps)
 21                {
 022                    return coloring[i].color;
 23                }
 24            }
 25
 026            return coloring[coloring.Length - 1].color;
 27        }
 28    }
 29}