AI-powered software quality analysis and defect prediction platform
Overview · Features · Architecture · Repositories · Tech Stack · Getting Started · Contributing
DefexHunter helps engineering teams find vulnerabilities, predict defect-prone modules, validate architecture diagrams, and assess project requirements — all from a single dashboard.
It combines CodeQL static analysis, machine-learning defect prediction, JM1/Halstead code metrics, fuzzy-logic risk scoring, and LLM-assisted requirement extraction into one unified workflow.
CodeQL-powered analysis across C/C++, C#, Go, Java, JavaScript/TypeScript, Python, and Ruby with native SARIF parsing and vulnerability classification.
ML models trained on standardized software datasets (NASA MDP / PROMISE). Extracts JM1 and Halstead metrics — cyclomatic complexity, volume, difficulty, effort — and predicts defect probability per file. Remote ML service with automatic local model fallback.
Automated syntax and semantic validation for PlantUML, Mermaid, and XMI/UML diagrams via a dedicated microservice.
Extracts requirements from PDF, DOCX, XLSX, and CSV documents. Uses LLMs to identify ambiguities, inconsistencies, missing requirements, and testability gaps.
Fuzzy-logic engine aggregating security findings, metric densities, and ML predictions into a normalized project health index.
Real-time project health dashboards, branch-level scan histories, and combined report exports in PDF, DOCX, and CSV. GitHub OAuth (PKCE) integration for seamless repository syncing.
flowchart TB
subgraph Client ["🖥️ Client Layer"]
UI["DefexHunter Frontend<br/>(Next.js · React · TypeScript)"]
end
subgraph Platform ["⚙️ Core Platform"]
API["FastAPI Gateway"]
subgraph Modules ["Modular Monolith"]
AUTH["Auth & OAuth"]
PROJ["Projects & Branches"]
SCANS["Scan & SARIF Engine"]
METRICS["Code Metrics"]
FUZZY["Risk Evaluator"]
TEXT["Requirement Analyzer"]
REPORTS["Report Exporter"]
end
DB[("PostgreSQL 15")]
end
subgraph Services ["🔌 External Services"]
CODEQL["CodeQL CLI"]
ML_SVC["DefexHunter-ML<br/>(XGBoost / scikit-learn)"]
DIAG_SVC["Diagram Validation<br/>(PlantUML / Mermaid / XMI)"]
LLM_API["LLM Provider"]
GH_API["GitHub API"]
end
UI <-->|"REST / JWT"| API
API --> AUTH & PROJ & SCANS & METRICS & FUZZY & TEXT & REPORTS
Modules <--> DB
SCANS -->|"Static Analysis"| CODEQL
METRICS & SCANS -->|"Predictions"| ML_SVC
PROJ -->|"Validation"| DIAG_SVC
TEXT -->|"Analysis"| LLM_API
AUTH & PROJ <-->|"OAuth / Repos"| GH_API
| Repository | Stack | Purpose |
|---|---|---|
| 🐍 DefexHunter-Backend | Python · FastAPI · PostgreSQL · CodeQL | Core API — orchestrates scans, metrics, predictions, risk scoring, and reports |
| 💻 DefexHunter-Frontend | TypeScript · React · Next.js · Tailwind CSS | Web dashboard — project management, analytics, scan results, report exports |
| 📊 DefexHunter-ML | Python · Jupyter · XGBoost · scikit-learn | ML research — dataset pipelines, feature engineering, model training |
| 🧩 diagram-validation-service | Python · FastAPI | Microservice — PlantUML, Mermaid, and XMI diagram parsing and validation |
| Layer | Technologies |
|---|---|
| Backend | Python 3.12, FastAPI, Uvicorn, Pydantic v2 |
| Database | PostgreSQL 15, SQLAlchemy 2 (async), asyncpg, Alembic |
| Frontend | TypeScript, React, Next.js, Tailwind CSS, Framer Motion |
| Static Analysis | CodeQL CLI, SARIF, Lizard |
| Machine Learning | scikit-learn, XGBoost, scikit-fuzzy, NumPy, Pandas |
| Diagram Parsing | PlantUML, Mermaid.js, XMI |
| Reporting | ReportLab (PDF), python-docx, Pandas (CSV/XLSX) |
| Infrastructure | Docker, Docker Compose |
- Docker Desktop or Docker Engine with Compose v2
- Git
# Clone and enter the backend
git clone https://github.com/DefexHunter/DefexHunter-Backend.git
cd DefexHunter-Backend
# Create environment file
cp .env.example .env # Linux / macOS
Copy-Item .env.example .env # Windows PowerShell
# Generate required secrets (edit .env with these values)
python -c "import secrets; print(secrets.token_urlsafe(64))"
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
# Launch the stack
docker compose up -d --buildOnce running:
| Endpoint | URL |
|---|---|
| 🌐 API | http://localhost:8000 |
| 📖 Swagger UI | http://localhost:8000/docs |
| 🏥 Health Check | http://localhost:8000/health |
See each repository's README for detailed setup and configuration.
- Fork the target repository.
- Create a feature branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -m "Add your feature" - Push and open a Pull Request.
Made with ❤️ by the DefexHunter team