Skip to main content
Glama
nimra-pixel

CodeAudit Agent

by nimra-pixel
README.md
<div align="center">

# ๐Ÿ” CodeAudit Agent

### AI-Powered Code Security, Quality & Performance Review

[![Python](https://img.shields.io/badge/Python-3.11+-3776AB?style=flat&logo=python&logoColor=white)](https://python.org)
[![LangGraph](https://img.shields.io/badge/LangGraph-1.2+-FF6B35?style=flat)](https://langchain-ai.github.io/langgraph/)
[![MCP](https://img.shields.io/badge/MCP-FastMCP-8B5CF6?style=flat)](https://github.com/jlowin/fastmcp)
[![Groq](https://img.shields.io/badge/Groq-Llama%203.3%2070B-F55036?style=flat)](https://groq.com)
[![Built by Nimra](https://img.shields.io/badge/Built%20by-Nimra%20Tariq-1A3A5C?style=flat&logo=github)](https://github.com/nimra-pixel)

**Paste any code โ†’ Get security vulnerabilities, quality issues, performance bottlenecks, auto-fix, and a graded report.**

Works as a Streamlit web app AND as an MCP server for VS Code.

</div>

---

## What it detects

| Category | Checks |
|----------|--------|
| ๐Ÿ”’ **Security** | OWASP Top 10 ยท SQL injection ยท XSS ยท hardcoded secrets ยท eval() ยท weak crypto ยท debug mode |
| โœจ **Quality** | SOLID violations ยท cyclomatic complexity ยท naming ยท DRY ยท magic numbers ยท error handling |
| โšก **Performance** | O(nยฒ) loops ยท N+1 queries ยท memory leaks ยท blocking I/O ยท string concat in loops |

## Languages supported

Python ยท JavaScript ยท TypeScript ยท Java ยท C++ ยท C ยท C# ยท Go ยท Rust ยท PHP ยท Ruby ยท Swift ยท Kotlin ยท SQL ยท Bash

---

## Architecture

```
Code input (Streamlit UI or VS Code via MCP)
    โ†“
LangGraph orchestrator
    โ†“ (parallel)
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Security     โ”‚ Quality      โ”‚ Performance  โ”‚
โ”‚ Agent        โ”‚ Agent        โ”‚ Agent        โ”‚
โ”‚ OWASP Top 10 โ”‚ SOLID/Clean  โ”‚ Big-O/leaks  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ†“
Fix Agent (auto-generates fixed code)
    โ†“
Scorer (computes grade A+ โ†’ F)
    โ†“
Report (.md + .json export)
```

---

## Quick Start

```bash
git clone https://github.com/nimra-pixel/codeaudit.git
cd codeaudit
pip install -r requirements.txt
cp .env.example .env    # add GROQ_API_KEY
streamlit run app.py
```

## MCP Server (for VS Code)

```bash
python mcp/server.py
```

Then install the VS Code extension from `vscode/` folder.

Right-click any code โ†’ **CodeAudit: Audit This File**

---

## MCP Tools exposed

| Tool | Description |
|------|-------------|
| `audit_code` | Full security + quality + performance audit |
| `quick_security_scan` | Security only (faster) |
| `detect_code_language` | Detect programming language |

Works with LangGraph, CrewAI, Claude Desktop, and any MCP client.

---

## Built by

**Nimra Tariq** โ€” AI Engineer & Assistant Professor, Superior University Lahore, Pakistan

[![GitHub](https://img.shields.io/badge/GitHub-nimra--pixel-181717?style=flat&logo=github)](https://github.com/nimra-pixel)

**Also built:** [MedAgent](https://github.com/nimra-pixel/medagent) ยท [DeepResearch](https://github.com/nimra-pixel/DeepResearch) ยท [VEMA](https://github.com/nimra-pixel/vema)

---
MIT License