TheDocumentation 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 command runs a sequenced, 19-step static analysis pipeline against a Fortran source directory and writes all output files to a single results directory. Every step runs in dependency order — from building the unit inventory through complexity analysis, dead code detection, clone identification, and finally generating a self-contained HTML report. Flags let you control which steps run, how errors are handled, and how much output appears on the console.
Usage
Flags
Path to the Fortran source directory to analyze. Sets the
FORT_SRC environment variable for the duration of the run. When omitted, the value of FORT_SRC in the shell environment is used, falling back to the tests/fixtures/ default from config.py.Directory where all output files will be written (CSVs, audit files, DOT graphs, HTML report, log). Sets
FORT_OUT. When omitted, falls back to the FORT_OUT environment variable and then to results/.Print the full step table alongside the active
FORT_SRC and FORT_OUT values, then exit without running any analysis. Useful for verifying which project and output paths are active before a run.Skip every step that comes before
STEP in the pipeline and begin execution at STEP (inclusive). All steps from STEP onward run in normal dependency order. Use --list to identify valid step names.Run only the steps listed (space-separated). All other steps are skipped. Steps are still executed in their canonical pipeline order regardless of the order they are listed on the command line.
Exclude the listed steps from the run. Every other step executes normally. Accepts one or more space-separated step names.
By default the pipeline halts as soon as any step fails. Pass this flag to proceed to the next step regardless of failures. All step outcomes are recorded in the final summary.
Raises the console log threshold from
INFO to WARNING, reducing terminal noise. In quiet mode each step is collapsed to a single line showing the step name, ✓ or ✗, and elapsed time — the full horizontal-rule headers are suppressed. The log file always retains full DEBUG-level detail regardless of this flag.Number of parallel worker processes for the steps that support per-file parallelism:
inventory, profiler, and blocks. Defaults to 1 (sequential). Can also be set via the FORT_WORKERS environment variable; explicit --workers takes precedence.Override the default log file location (
<output>/forti4d.log). The parent directory must already exist. Ignored if --no-log-file is also passed.Disable the log file entirely. All
loguru output is directed to the console only. Useful in CI pipelines where log file artifacts are not needed.Step Names
All 19 steps run in the dependency order shown below. Pass anyName to --from, --only, or --skip.
| # | Name | Description |
|---|---|---|
| 1 | inventory | Build unit inventory from source files |
| 2 | dependencies | Build call graph and compute Fan-In/Fan-Out |
| 3 | profiler | Classify statements and produce audit/ DEBUG files |
| 4 | blocks | Block topology analysis (one file per source, to <FORT_OUT>/blocks/) |
| 5 | structure_analysis | Classify files by architectural role |
| 6 | cross_analysis | Assign migration strategy per unit |
| 7 | executive_summary | Generate executive summary |
| 8 | complexity | Compute McCabe cyclomatic complexity |
| 9 | common_blocks | Detect COMMON block coupling |
| 10 | symbols | Extract variable/parameter/implicit symbols per unit |
| 11 | derived_types | Extract derived TYPE definitions and their components |
| 12 | equivalences | Detect EQUIVALENCE aliasing groups (union-find) |
| 13 | reachability | Dead code detection from entry points |
| 14 | sloc | Precise SLOC count per unit |
| 15 | clones | Detect identical/similar/diverged duplicate units |
| 16 | consolidate | Join all reports into report_consolidated.csv |
| 17 | visual_graph | Generate call graph DOT files |
| 18 | prioritization | Compute composite risk score and rank units for migration |
| 19 | html_report | Generate self-contained HTML report |
The
blocks step has no single backing script. It batch-runs block_analysis once per *_DEBUG.csv file found in <FORT_OUT>/audit/. It requires the profiler step to have run first.Step Selection
Three flags let you narrow the set of steps that execute. They compose with each other:--from is applied first, --only second, and --skip last.
Combining Flags
All flags compose freely on a single command line:../myproject as the source directory, writes results to out/, starts execution at the complexity step (skipping the eight earlier steps), and suppresses verbose console output. The log file at out/forti4d.log still records full DEBUG-level detail.
Another common pattern during development is running a partial pipeline while keeping it resilient:
Terminal Output Format
Each step produces a header block followed by a result line. In normal (non---quiet) mode the output looks like:
--quiet, the horizontal rule headers are suppressed and each step collapses to a single line showing the step name, ✓ or ✗, and elapsed time. The final summary table is always printed regardless of --quiet.
When a step fails and --continue-on-error is not set, the pipeline prints a message and exits:
The log file (
<output>/forti4d.log) always captures full DEBUG-level detail regardless of the --quiet flag. --quiet only affects what appears on the console. Use --log-file PATH to write the log to a different location, or --no-log-file to disable it entirely.