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.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.
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
Key capabilities
| Capability | Output file |
|---|---|
| Unit inventory | inventory_report.csv |
| Call graph & Fan-In/Fan-Out | dep_02_unit_graph.csv, dep_03_impact_matrix.csv |
| Statement density profile | report_density.csv |
| McCabe cyclomatic complexity | report_complexity.csv |
| Dead code detection | report_reachability.csv |
| Clone detection | report_clones.csv |
| COMMON block coupling | common_coupling.csv |
| Symbol declarations | symbol_variables.csv, symbol_signatures.csv |
| Migration risk ranking | report_prioritization.csv |
| Interactive HTML report | report.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.