< Summary

Information
Class: Ice.Internal.Util
Assembly: Ice
File(s): /home/runner/work/ice/ice/csharp/src/Ice/Internal/Util.cs
Tag: 71_18251537082
Line coverage
56%
Covered lines: 9
Uncovered lines: 7
Coverable lines: 16
Total lines: 41
Line coverage: 56.2%
Branch coverage
50%
Covered branches: 7
Total branches: 14
Branch coverage: 50%
Method coverage
100%
Covered methods: 2
Total methods: 2
Method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
getInstance(...)100%11100%
stringToThreadPriority(...)50%33.921453.33%

File(s)

/home/runner/work/ice/ice/csharp/src/Ice/Internal/Util.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3namespace Ice.Internal;
 4
 5public sealed class Util
 6{
 17    public static Instance getInstance(Ice.Communicator communicator) => communicator.instance;
 8
 9    public static ThreadPriority stringToThreadPriority(string s)
 10    {
 111        if (string.IsNullOrEmpty(s))
 12        {
 113            return ThreadPriority.Normal;
 14        }
 115        if (s.StartsWith("ThreadPriority.", StringComparison.Ordinal))
 16        {
 017            s = s.Substring("ThreadPriority.".Length, s.Length);
 18        }
 119        if (s == "Lowest")
 20        {
 021            return ThreadPriority.Lowest;
 22        }
 123        else if (s == "BelowNormal")
 24        {
 025            return ThreadPriority.BelowNormal;
 26        }
 127        else if (s == "Normal")
 28        {
 029            return ThreadPriority.Normal;
 30        }
 131        else if (s == "AboveNormal")
 32        {
 133            return ThreadPriority.AboveNormal;
 34        }
 035        else if (s == "Highest")
 36        {
 037            return ThreadPriority.Highest;
 38        }
 039        return ThreadPriority.Normal;
 40    }
 41}