protected override IEnumerable <SyntaxNode> PublicApiNodes => new SyntaxNode[0]; // not calculated for VB.Net public override int GetComplexity(SyntaxNode node) { var possibleNodes = node .DescendantNodesAndSelf() .Where(n => !n.Parent.IsKind(SyntaxKind.InterfaceBlock) && ComplexityIncreasingKinds.Contains(n.Kind())); return(possibleNodes.Count(n => !IsFunctionLikeLastReturnStatement(n))); }
public static int Complexity(SyntaxNode node) { return(node .DescendantNodesAndSelf() .Count( n => // TODO What about the null coalescing operator? ComplexityIncreasingKinds.Contains(n.Kind()) || IsReturnButNotLast(n) || IsFunctionAndHasBlock(n))); }
public override int GetComplexity(SyntaxNode node) { return(node .DescendantNodesAndSelf() .Count( n => // TODO What about the null coalescing operator? ComplexityIncreasingKinds.Contains(n.Kind()) || IsReturnButNotLast(n) || IsFunctionWithBody(n))); }
protected override IEnumerable <SyntaxNode> PublicApiNodes => Enumerable.Empty <SyntaxNode>(); // Not calculated for VB.Net private bool IsComplexityIncreasingKind(SyntaxNode node) => ComplexityIncreasingKinds.Contains(node.Kind());
protected override bool IsComplexityIncreasingKind(SyntaxNode node) => ComplexityIncreasingKinds.Contains(node.Kind());