Skip to content
@DefexHunter

DefexHunter

AI-driven software quality platform combining static analysis, ML defect prediction, and LLM-powered requirement extraction to help teams ship safer code.

🎯 DefexHunter

AI-powered software quality analysis and defect prediction platform

Backend Frontend ML Security Docker

Overview · Features · Architecture · Repositories · Tech Stack · Getting Started · Contributing


📌 Overview

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.


✨ Features

🛡️ Static Code Analysis

CodeQL-powered analysis across C/C++, C#, Go, Java, JavaScript/TypeScript, Python, and Ruby with native SARIF parsing and vulnerability classification.

🤖 Defect Prediction

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.

📐 Diagram Validation

Automated syntax and semantic validation for PlantUML, Mermaid, and XMI/UML diagrams via a dedicated microservice.

📄 Requirement Analysis

Extracts requirements from PDF, DOCX, XLSX, and CSV documents. Uses LLMs to identify ambiguities, inconsistencies, missing requirements, and testability gaps.

⚖️ Risk Scoring

Fuzzy-logic engine aggregating security findings, metric densities, and ML predictions into a normalized project health index.

📊 Reporting & Dashboard

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.


🏗️ Architecture

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
Loading

📂 Repositories

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

🛠️ Tech Stack

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

🚀 Getting Started

Prerequisites

Quick Start

# 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 --build

Once 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.


🤝 Contributing

  1. Fork the target repository.
  2. Create a feature branch: git checkout -b feature/your-feature
  3. Commit your changes: git commit -m "Add your feature"
  4. Push and open a Pull Request.

Made with ❤️ by the DefexHunter team

Pinned Loading

  1. DefexHunter-ML DefexHunter-ML Public

    Jupyter Notebook

Repositories

Showing 6 of 6 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…