< Summary

Information
Class: Elsa.Extensions.ActivityNodeExtensions
Assembly: Elsa.Workflows.Core
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Extensions/ActivityNodeExtensions.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 26
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Flatten()100%44100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Core/Extensions/ActivityNodeExtensions.cs

#LineLine coverage
 1using Elsa.Workflows.Models;
 2
 3// ReSharper disable once CheckNamespace
 4namespace Elsa.Extensions;
 5
 6/// <summary>
 7/// Provides extension methods for <see cref="ActivityNode"/>.
 8/// </summary>
 9public static class ActivityNodeExtensions
 10{
 11    /// <summary>
 12    /// Returns a flattened list of the specified node and all its descendants.
 13    /// </summary>
 14    public static IEnumerable<ActivityNode> Flatten(this ActivityNode root)
 15    {
 1744316        yield return root;
 17
 6140218        foreach (var node in root.Children)
 19        {
 1325820            var children = node.Flatten();
 21
 8658422            foreach (var child in children)
 3003423                yield return child;
 24        }
 1744325    }
 26}

Methods/Properties

Flatten()