< Summary

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

Feature is only available for sponsors

Upgrade to PRO version

Metrics

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

File(s)

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

#LineLine coverage
 1namespace Elsa.Expressions.CSharp.Extensions;
 2
 3public static class VariableNameExtensions
 4{
 5    public static bool IsValidVariableName(this string name)
 6    {
 07        return !string.IsNullOrWhiteSpace(name) && name.All(char.IsLetterOrDigit);
 8    }
 9
 10    public static bool IsInvalidVariableName(this string name)
 11    {
 012        return !IsValidVariableName(name);
 13    }
 14
 15    public static IEnumerable<string> FilterInvalidVariableNames(this IEnumerable<string> names)
 16    {
 017        return names.Where(IsValidVariableName);
 18    }
 19}