CLI that parses COBOL and writes Markdown summaries (program structure, unused paragraphs, call and control flow).
- Rust 1.85 or later: https://rustup.rs/
git clone https://github.com/Cod-e-Codes/codesleuth.git
cd codesleuth
cargo build --releaseThe binary is target/release/codesleuth (.exe on Windows).
./target/release/codesleuth analyze path/to/cobolanalyze accepts a file or a directory of .cob / .cbl / .cobol files.
Flags:
--verboseextra progress on stderr--debuginternal trace on stderr--workers Nconcurrent workers (default: available parallelism)--benchmarkprint wall-clock throughput after analysis (Enabled,FilesProcessed,TotalTimeSec,Throughput,StartTime,EndTime)--output PATHMarkdown file if the input is a file; directory of flattened.mdnames if the input is a directory
Flattened report names strip :, replace / and \ with _, and drop the source extension.
Other subcommands:
./target/release/codesleuth parse file.cob
./target/release/codesleuth summarize -i ir.json -o report.mdparse writes IR JSON to stdout. summarize reads IR JSON (file or stdin) and writes Markdown.
Load-test file writer (not used as verification):
cargo run --bin gen_dummy -- --count 1000 --outdir dummy-cobolThe parser is not a complete COBOL implementation.
- COPY looks up members next to the source and in
COPYBOOK,COPYLIB, orcopybooksdirectories walking up from the file. It does not search a z/OS library (SYSLIB,COPY...OF/IN). If the member is not found, COPY remains a copybook data item. - Not a Db2 coprocessor: no DBRM, no generated SQLCA. DATA DIVISION DECLARE TABLE, DECLARE CURSOR, and INCLUDE when the member is missing are not data items.
--workersisolates unwinding panics per file (catch_unwind). The process still exits if Rust is built withpanic = "abort", on a double panic, or on some stack overflows.
IR JSON shape: docs/ir_schema.json.
Continuous integration has two required jobs: rust (cargo fmt --check, cargo test, clippy -D warnings, cargo build --release) and corpus (clone openmainframeproject/cobol-programming-course at 1f037d24326124f4f2c5cd2d31e5220ceb549580, CC-BY-4.0, then analyze --workers and analyze --benchmark). Clone or analyze failure fails the corpus job.
Report failures in issues.
See CONTRIBUTING.md and CODE_OF_CONDUCT.md.
Open a GitHub issue.
Cody Marsengill (Cod-e-Codes)
MIT. For licensing questions, email cod.e.codes.dev@gmail.com.