Statically analyze your COBOL codebase and score each module across 5 risk dimensions β so your team migrates smart, not blind.
CORisk/
βββ backend/
β βββ app.py β Flask API server (main entry point)
β βββ analyzer.py β Core COBOL risk analysis engine
β βββ requirements.txt β Python dependencies
β
βββ frontend/
β βββ public/
β β βββ index.html β HTML shell with Google Fonts
β βββ src/
β β βββ index.js β React entry point
β β βββ index.css β Global CSS variables & theme
β β βββ App.js β Root component (page routing)
β β βββ pages/
β β β βββ LandingPage.js β Upload page
β β β βββ LandingPage.module.css
β β β βββ DashboardPage.js β Results dashboard
β β β βββ DashboardPage.module.css
β β βββ components/
β β βββ SummaryCards.js β KPI stat cards + donut chart
β β βββ SummaryCards.module.css
β β βββ ModuleTable.js β Sortable/filterable table
β β βββ ModuleTable.module.css
β β βββ ModuleDetail.js β Side panel with radar chart
β β βββ ModuleDetail.module.css
β β βββ DependencyGraph.js β D3 force-directed canvas graph
β β βββ DependencyGraph.module.css
β β βββ MigrationPlan.js β Phased roadmap + checklist
β β βββ MigrationPlan.module.css
β βββ package.json
β
βββ sample_cobol/
β βββ CUSTPROC.cob β Customer processing (HIGH risk demo)
β βββ VALCUST.cob β Validation utility (LOW risk demo)
β βββ RPTGEN.cob β Report generator (MEDIUM risk demo)
β
βββ README.md
| Tool | Version | Install |
|---|---|---|
| Python | 3.9+ | https://python.org |
| Node.js | 18+ | https://nodejs.org |
| npm | 9+ | Comes with Node.js |
| Git | any | https://git-scm.com |
Check your versions:
python --version
node --version
npm --version# If using git:
git clone <your-repo-url>
cd CORisk
# OR if you downloaded a zip, just extract and cd into it:
cd CORisk# Navigate to backend folder
cd backend
# Create a virtual environment (recommended)
python -m venv venv
# Activate it:
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Start the Flask server
python app.pyβ You should see:
* Running on http://127.0.0.1:5000
* Debug mode: on
Leave this terminal open!
Open a new terminal window:
# From the CORisk root directory
cd frontend
# Install all npm packages (takes ~1-2 minutes first time)
npm install
# Start the React dev server
npm startβ Your browser will auto-open at:
http://localhost:3000
- Open http://localhost:3000
- Click "Try Sample Files"
- The backend loads the 3 sample COBOL files from
sample_cobol/ - Results appear instantly on the Dashboard
- Open http://localhost:3000
- Drag & drop your
.cob/.cbl/.cpyfiles onto the dropzone - Click "β‘ Analyze Risk"
- Explore the 4 dashboard tabs:
- π Overview β Summary KPI cards + quick module list
- π Module Scores β Full sortable table; click any row for detail panel
- πΈοΈ Dependency Graph β Interactive force graph; drag nodes, click for details
- πΊοΈ Migration Plan β Phase-by-phase roadmap + MRI bar chart + checklist
| Metric | Weight | What It Measures |
|---|---|---|
| Coupling Density | 30% | Inbound CALLs + shared file operations |
| Documentation Deficit | 25% | Comment-to-code ratio (low = risky) |
| Logic Volatility | 20% | GOTO count + paragraph count |
| Data Complexity | 15% | REDEFINES + COMP-3 + EBCDIC fields |
| Dead Code Ratio | 10% | Paragraphs defined but never PERFORMed |
MRI (Migration Risk Index) = weighted sum of all 5 metrics (0β100).
| MRI Range | Risk Tier | Action |
|---|---|---|
| 0β34 | π’ LOW | Safe to migrate now |
| 35β59 | π‘ MEDIUM | Migrate with caution |
| 60β100 | π΄ HIGH | Do NOT migrate yet |
AI suggestions are powered by Groq's free LLM API (llama3-8b-8192).
The API key lives only in backend/.env β it is never sent to the frontend.
- Go to https://console.groq.com/
- Sign up (free, no credit card needed)
- Click "API Keys" β "Create API Key"
- Copy the key
Open backend/.env and replace the placeholder:
GROQ_API_KEY=gsk_your_actual_key_here
GROQ_MODEL=llama3-8b-8192
# Stop the backend (Ctrl+C) then restart:
python app.pycurl http://localhost:5000/api/ai-status
# Should return: {"configured": true, ...}β The dashboard header now shows "π€ AI Ready" in green.
- When you click "Get AI Suggestions" on a MEDIUM/HIGH risk module β backend calls Groq β returns structured JSON
- When you click "Generate AI Suggestions for All Modules" in the Migration Plan tab β batch call for all risky modules
- LOW risk modules are skipped automatically
- The API key is never exposed to the React frontend
| Model | Speed | Quality |
|---|---|---|
llama3-8b-8192 |
β‘ Fastest | Good (default) |
llama3-70b-8192 |
Slower | Best quality |
mixtral-8x7b-32768 |
Medium | Great for long context |
Change model in backend/.env:
GROQ_MODEL=llama3-70b-8192
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/health |
Health check + AI status |
| POST | /api/analyze |
Upload and analyze COBOL files |
| GET | /api/analyze-sample |
Analyze built-in sample files |
| POST | /api/ai-suggest |
Get AI suggestions for a single module |
| POST | /api/ai-suggest-all |
Get AI suggestions for all MEDIUM+HIGH modules |
| GET | /api/ai-status |
Check if Groq API key is configured |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/health |
Health check |
| POST | /api/analyze |
Upload and analyze COBOL files |
| GET | /api/analyze-sample |
Analyze built-in sample files |
curl -X POST http://localhost:5000/api/analyze \
-F "files=@CUSTPROC.cob" \
-F "files=@VALCUST.cob"Make sure the Flask backend is running on port 5000.
Ensure your files have .cob, .cbl, or .cpy extensions.
Backend is not running. Start it first with python app.py.
# Kill whatever is on port 3000, or use a different port:
PORT=3001 npm start# Edit backend/app.py, change the last line to:
app.run(debug=True, port=5001)
# Then update frontend/package.json "proxy" to http://localhost:5001Just drop .cob or .cbl files into sample_cobol/ to expand the sample dataset.
Or upload any number of files directly via the UI.
| Layer | Technology |
|---|---|
| Backend | Python 3 + Flask + Flask-CORS |
| Analysis | Pure Python regex + graph algorithms |
| Frontend | React 18 + CSS Modules |
| Charts | Recharts (radar, bar, radial) |
| Graph | Canvas 2D API with custom force simulation |
| Fonts | Syne (display) + DM Sans (body) + DM Mono |
MIT β free to use, modify, and publish.
Built with β€οΈ at RISHA Lab, IIT Tirupati.