fallow viz
See where dead code, duplication, boundary violations, and complexity sit in your codebase. Fallow viz writes one self-contained HTML map with a file treemap and an import graph.
Use fallow viz to see where the findings sit in your codebase, and to click from a finding to the evidence behind it. The command runs one project analysis and writes one self-contained HTML file. The file needs no server and no external assets, and it has the same style as the rest of fallow. fallow viz is read-only.
fallow viz # writes fallow-viz.html and opens it in your browser
fallow viz --out map.html --no-open
fallow viz --viz-format dot # emit the import graph as Graphviz DOT
fallow viz --viz-format mermaid # emit the import graph as a Mermaid diagram
The two views
The HTML map has two views of the same project:
- Treemap of files sized by bytes, nested by directory.
- Force-directed import graph, with clusters by directory and by import community. When you focus a file, an import that loads its target only on demand (
import(), a lazy glob, a worker) has a dashed line.
The four lenses
Each lens gives the map different colors. The two views share the four lenses:
| Lens | What it shows |
|---|---|
| Dead code | Unused files, unused exports, and entry points |
| Duplication | Share of duplicated lines per file, with clone previews |
| Boundaries | Architecture zones from your boundaries config, with violating imports drawn in red |
| Complexity hotspots | Per-function cyclomatic and cognitive scores, including React context such as hook counts and JSX depth |
Click a file to open a detail panel. The panel shows the evidence behind each finding:
- unused export names
- clone groups and their other locations
- boundary crossings
- cycle membership
- importers and imports, as links to click through
- a
fallow ... --tracecommand that you can run to verify the finding
The map also has search, breadcrumb drill-down, keyboard shortcuts, shareable URL deep links, and dark and light themes. Findings have a hatch texture and an [E] or [W] prefix, so color is never the only signal. All motion follows prefers-reduced-motion.
Options
| Flag | Description |
|---|---|
--out <PATH> | Output file path (default: fallow-viz.html in the project root) |
--no-open | Do not open the output file in the browser |
--viz-format <FORMAT> | Output format: html (default), dot (Graphviz), or mermaid |
Global flags such as --root, --config, --production, --no-cache, --changed-since, --workspace, and --threads also apply.
Text formats
To pipe the import graph into other tools, use --viz-format dot or --viz-format mermaid. Fallow then writes the graph as text, and does not write the HTML map:
fallow viz --viz-format dot | dot -Tsvg -o graph.svg
fallow viz --viz-format mermaid > graph.mmd
See also
Find the unused code that the dead code lens shows.
Find the duplication that the duplication lens shows.
Find the complexity hotspots that the complexity lens shows.
Verify one finding from the command line, with the same --trace command that each detail panel shows.