Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/acdeveloper-sci/forti4d/llms.txt

Use this file to discover all available pages before exploring further.

Forti4D analyses a directory of Fortran source files and writes a structured set of CSV reports, a Markdown executive summary, optional call graph DOT files, and a self-contained interactive HTML report — all in a single command. This guide walks you through your first run from install to opening the report in a browser.
1

Install Forti4D

Install the package from PyPI with pip or uv:
pip install forti4d
Verify the install by listing the pipeline steps:
forti4d --list
You should see all 19 steps printed to the terminal along with the active FORT_SRC and FORT_OUT paths.
2

Run the full pipeline

Point --project at the root of your Fortran source tree and --output at the directory where you want results written:
forti4d --project /path/to/fortran/source --output results/
The pipeline runs all 19 steps in dependency order. Each step prints its name, description, a pass/fail indicator, and elapsed time:
=== Fortran Static Analysis Pipeline ===
Project : /path/to/fortran/source
Output  : results/
Steps   : 19

────────────────────────────────────────────────────────────
[1/19] inventory  —  Build unit inventory from source files
────────────────────────────────────────────────────────────

  ✓ OK  2.3s

────────────────────────────────────────────────────────────
[2/19] dependencies  —  Build call graph and compute Fan-In/Fan-Out
────────────────────────────────────────────────────────────

  ✓ OK  8.7s

...
When all steps finish, a summary table is printed:
────────────────────────────────────────────────────────────
Summary  —  45.1s total
────────────────────────────────────────────────────────────
  ✓  inventory              2.3s
  ✓  dependencies           8.7s
  ✓  profiler               5.1s
  ✓  blocks                 3.4s
  ✓  structure_analysis     0.8s
  ✓  cross_analysis         0.9s
  ✓  executive_summary      0.5s
  ✓  complexity             1.2s
  ✓  common_blocks          0.7s
  ✓  symbols                2.1s
  ✓  derived_types          0.4s
  ✓  equivalences           0.3s
  ✓  reachability           1.5s
  ✓  sloc                   1.1s
  ✓  clones                 4.6s
  ✓  consolidate            0.6s
  ✓  visual_graph           1.8s
  ✓  prioritization         0.5s
  ✓  html_report            0.9s

All 19 steps completed successfully.
Full log: results/forti4d.log
3

Explore the output files

The results/ directory now contains the full analysis. Key files to look at first:
FileDescription
report.htmlSelf-contained HTML report — filterable and sortable unit table
PROJECT_SUMMARY.mdExecutive summary in Markdown
report_prioritization.csvUnits ranked by composite migration risk score
report_consolidated.csvAll metrics joined — one row per unit
report_reachability.csvDead code detection — units unreachable from any entry point
report_complexity.csvMcCabe cyclomatic complexity per unit
report_clones.csvIdentical, similar, and diverged duplicate unit pairs
dep_02_unit_graph.csvResolved call graph (CALL, USE, FUNC_CALL edges)
dep_03_impact_matrix.csvFan-In and Fan-Out per unit
graph_*.dotGraphviz call graphs (full, simplified, and per entry point)
4

Open the HTML report

Open results/report.html directly in any browser — no server required:
# macOS
open results/report.html

# Linux
xdg-open results/report.html

# Windows (PowerShell)
Start-Process results/report.html
The report is fully self-contained (no external CDN dependencies) and provides a filterable, sortable table of every program unit in the corpus with all collected metrics in one view.

Running Selected Steps

You do not need to run all 19 steps every time. Forti4D provides three flags for controlling which steps execute: Resume from a step — skip all earlier steps and start from the named step (inclusive):
forti4d --project /path/to/source --output results/ --from complexity
Run only specific steps — useful for refreshing a single report without re-running the full pipeline:
forti4d --project /path/to/source --output results/ --only sloc consolidate html_report
Skip specific steps — run everything except the listed steps:
forti4d --project /path/to/source --output results/ --skip visual_graph
Flags can be combined freely. For example, to resume from symbols and skip visual_graph:
forti4d --project /path/to/source --output results/ --from symbols --skip visual_graph

Quiet Mode

By default, each step prints its full diagnostic output to the console. Pass --quiet to suppress this and show only step names, pass/fail indicators, and elapsed time:
forti4d --project /path/to/source --output results/ --quiet
--quiet only affects the console. Every run writes a full-detail log at DEBUG level to results/forti4d.log regardless of this flag. Use --log-file PATH to write the log to a different location, or --no-log-file to disable it entirely.

Parallel Execution

The inventory, profiler, and blocks steps support per-file parallelism. Use --workers to set the number of parallel worker processes:
forti4d --project /path/to/source --output results/ --workers 4
You can also set this via the FORT_WORKERS environment variable, which is useful for CI environments or shell aliases:
FORT_WORKERS=4 forti4d --project /path/to/source --output results/
An explicit --workers argument always takes precedence over FORT_WORKERS. If neither is set, the pipeline runs sequentially (one worker).

Continue on Error

By default, the pipeline stops at the first failing step. Use --continue-on-error to proceed past failures and collect results from as many steps as possible:
forti4d --project /path/to/source --output results/ --continue-on-error
See the CLI Reference for the complete flag reference, including environment variable configuration (FORT_SRC, FORT_OUT, FORT_WORKERS) and advanced usage patterns.

Build docs developers (and LLMs) love