< Summary

Information
Class: Elsa.Expressions.JavaScript.Extensions.VariableNameExtensions
Assembly: Elsa.Expressions.JavaScript
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.JavaScript/Extensions/VariableNameExtensions.cs
Line coverage
66%
Covered lines: 2
Uncovered lines: 1
Coverable lines: 3
Total lines: 21
Line coverage: 66.6%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
IsValidVariableName(...)100%11100%
IsInvalidVariableName(...)100%210%
FilterInvalidVariableNames(...)100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.JavaScript/Extensions/VariableNameExtensions.cs

#LineLine coverage
 1using Elsa.Expressions.JavaScript.Helpers;
 2
 3namespace Elsa.Expressions.JavaScript.Extensions;
 4
 5public static class VariableNameExtensions
 6{
 7    public static bool IsValidVariableName(this string name)
 8    {
 3829        return VariableNameValidator.IsValidVariableName(name);
 10    }
 11
 12    public static bool IsInvalidVariableName(this string name)
 13    {
 014        return !VariableNameValidator.IsValidVariableName(name);
 15    }
 16
 17    public static IEnumerable<string> FilterInvalidVariableNames(this IEnumerable<string> names)
 18    {
 61119        return names.Where(IsValidVariableName);
 20    }
 21}