public override void VisitClassDeclaration(ClassDeclarationSyntax node) { if (node.ShouldBeHidden()) return; ++ClassDepth; if (ClassDepth == 1) { base.VisitClassDeclaration(node); } else if (node.ChildNodes().All(childNode => childNode is PropertyDeclarationSyntax || childNode is AttributeListSyntax)) { // simple nested POCO var line = node.SyntaxTree.GetLineSpan(node.Span).StartLinePosition.Line; var walker = new CodeWithDocumentationWalker(ClassDepth - 2, line); walker.Visit(node); this.Blocks.AddRange(walker.Blocks); } else { var methods = node.ChildNodes().OfType<MethodDeclarationSyntax>(); if (!methods.Any(m => m.AttributeLists.SelectMany(a => a.Attributes).Any())) { // nested class with methods that are not unit or integration tests e.g. example PropertyVisitor in Automap.doc.cs var line = node.SyntaxTree.GetLineSpan(node.Span).StartLinePosition.Line; var walker = new CodeWithDocumentationWalker(ClassDepth - 2, line); walker.Visit(node); this.Blocks.AddRange(walker.Blocks); } } --ClassDepth; }