# Graph Statistics

## Overview

- **Total documents:** {{ totalDocuments }}
- **Total nodes:** {{ totalNodes }}
- **Total paths:** {{ totalPaths }}

## Document Statistics

- **Total sections:** {{ totalSections }}
- **Average sections/doc:** {{ avgSectionsPerDoc|round(2) }}

{%- if topDocsBySections %}

### Top Documents by Sections

{% for item in topDocsBySections -%}
{{ loop.index }}. **{{ item.title }}** ({{ item.sections }} sections)
{% endfor %}
{%- endif %}

## Reference Statistics

- **Block references:** {{ block_references }}
- **Inline references:** {{ inline_references }}
- **Total references:** {{ totalReferences }}
- **Orphaned documents:** {{ orphanedDocuments }} ({{ orphanedPercentage|round(1) }}%)
- **Leaf documents:** {{ leafDocuments }} ({{ leafPercentage|round(1) }}%)

{%- if topReferenced %}

### Top Referenced Documents

{% for item in topReferenced -%}
{{ loop.index }}. **{{ item.title }}** ({{ item.incomingEdgesCount }})
{% endfor %}
{%- endif %}

## Lines Statistics

- **Total lines:** {{ totalLines }}
- **Average lines/doc:** {{ avgLinesPerDoc|round(2) }}

{%- if topDocsByLines %}

### Top Documents by Lines

{% for item in topDocsByLines -%}
{{ loop.index }}. **{{ item.title }}** ({{ item.lines }} lines)
{% endfor %}
{%- endif %}

## Words Statistics

- **Total words:** {{ totalWords }}
- **Average words/doc:** {{ avgWordsPerDoc|round(2) }}

{%- if topDocsByWords %}

### Top Documents by Words

{% for item in topDocsByWords -%}
{{ loop.index }}. **{{ item.title }}** ({{ item.words }} words)
{% endfor %}
{%- endif %}

## Structure Statistics

- **Root sections:** {{ rootSections }}
- **Maximum path depth:** {{ maxPathDepth }}
- **Average path depth:** {{ avgPathDepth|round(2) }}
- **Bullet lists:** {{ bulletLists }}
- **Ordered lists:** {{ orderedLists }}
- **Code blocks:** {{ codeBlocks }}
- **Tables:** {{ tables }}
- **Quotes:** {{ quotes }}

{%- if brokenLinks %}

## Broken Links

{% for link in brokenLinks -%}
- {{ link.sourceKey }} -> {{ link.targetKey }}
{% endfor %}
{%- endif %}

## Network Analysis

- **Average references/doc:** {{ avgRefsPerDoc|round(2) }}

{%- if mostConnected %}

### Most Connected Documents

{% for item in mostConnected -%}
{{ loop.index }}. **{{ item.title }}** ({{ item.totalEdgesCount }} connections)
{% endfor %}
{%- endif %}
