< Summary

Information
Class: Elsa.Common.Helpers.TypeHelper
Assembly: Elsa.Common
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Common/Helpers/TypeHelper.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 3
Coverable lines: 3
Total lines: 13
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 8
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
GetLatestType(...)0%7280%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Common/Helpers/TypeHelper.cs

#LineLine coverage
 1using System.Reflection;
 2
 3namespace Elsa.Common.Helpers;
 4
 5public static class TypeHelper
 6{
 7    public static Type GetLatestType(string typeName)
 8    {
 09        var type = Type.GetType(typeName);
 010        var deprecatedByTypeAttribute = type?.GetCustomAttribute<ForwardedTypeAttribute>();
 011        return deprecatedByTypeAttribute?.NewType ?? type ?? throw new InvalidOperationException($"Type {typeName} not f
 12    }
 13}

Methods/Properties

GetLatestType(System.String)