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 is a Python toolkit for static analysis of Fortran source code. It runs a 19-step pipeline against hybrid F77/F90/F95 corpora — the kind of real-world legacy code where general-purpose parsers typically fail — and produces structured CSV reports, Graphviz call graphs, and a self-contained HTML report with filterable, sortable results.

Installation

Install forti4d with pip and verify your setup in under a minute.

Quickstart

Run your first analysis and explore the outputs in a few steps.

CLI Reference

Every flag, option, and step name for the forti4d command.

Library API

Use forti4d as an in-process Python library with run_pipeline().

What forti4d analyzes

Forti4D treats a Fortran codebase as a four-dimensional object (the MI4D model) and extracts metrics across four axes: physical file topology, logical program structure, symbol scope, and control-flow state. The full 19-step pipeline covers:

Unit Inventory

Every PROGRAM, MODULE, SUBROUTINE, and FUNCTION with its type, parent, and line range.

Call Graph

CALL, USE, and function-call edges resolved to a Fan-In / Fan-Out impact matrix.

Complexity

McCabe cyclomatic complexity, precise SLOC counts, and clone detection per unit.

Dead Code

BFS reachability from all entry points flags units that are never called.

Scope Analysis

Variable declarations, derived types, IMPLICIT rules, and EQUIVALENCE aliasing.

Migration Risk

Composite risk scores rank every unit for F77→F90/modern migration effort.

Get started in three steps

1

Install forti4d

pip install forti4d
2

Run the full pipeline against your project

forti4d --project /path/to/fortran/source --output results/
3

Open the HTML report

Open results/report.html in a browser. Use the built-in filters to sort units by risk score, complexity, or reachability status.

Key capabilities

CapabilityOutput file
Unit inventoryinventory_report.csv
Call graph & Fan-In/Fan-Outdep_02_unit_graph.csv, dep_03_impact_matrix.csv
Statement density profilereport_density.csv
McCabe cyclomatic complexityreport_complexity.csv
Dead code detectionreport_reachability.csv
Clone detectionreport_clones.csv
COMMON block couplingcommon_coupling.csv
Symbol declarationssymbol_variables.csv, symbol_signatures.csv
Migration risk rankingreport_prioritization.csv
Interactive HTML reportreport.html
Forti4D supports FORTRAN 77, Fortran 90, and Fortran 95. Fortran 2003+ OOP features (CLASS, TYPE EXTENDS, procedure pointers) are not currently analyzed. See Known Limitations for details.

Build docs developers (and LLMs) love