AlexsanderHamir/code-complexity-analyzer

Code complexity analyzer with AI insights and data visualization. Evaluates code quality, identifies issues, and suggests improvements for multiple programming languages.

★ 0Forks 0TypeScriptGitHub ↗Compare

Project website ↗

README

CodeAnalyzer AI

A full-stack code analysis application powered by Claude AI that transforms code into interactive data visualizations, providing complexity scoring, suggestions, and insights through rich charts and dashboards.

Screenshot 2025-08-19 at 3 00 59 PM

Live Demo

🚀 View Live Application

Features

Interactive Data Visualization

  • Complexity Gauge - Circular progress chart with color-coded complexity scoring (1-100)
  • Code Metrics Dashboard - Bar charts showing functions, lines of code, and conditionals
  • Severity-Coded Suggestions - Color-categorized feedback cards (Critical, Warning, Info, Good)
  • Real-time Charts - Interactive Recharts components with responsive design
  • Visual History Browser - Timeline view of past analyses with complexity indicators

AI-Powered Analysis

  • Multi-Language Support - Auto-detects 30+ programming languages
  • Smart Complexity Scoring - 1-100 scale with detailed breakdown
  • Contextual Suggestions - Categorized feedback with severity levels
  • Function-Level Analysis - Individual component breakdown

User Experience

  • Modern Interface - Clean design with smooth animations and toast notifications
  • History Management - Save and revisit analyses with privacy controls
  • Mobile-Responsive - Works seamlessly across all devices
  • Real-time Feedback - Instant visual updates and loading states

Tech Stack

Backend: FastAPI, Claude AI API, Pydantic
Frontend: Next.js 14, TypeScript, Tailwind CSS, Recharts
Data: localStorage with smart cleanup and privacy controls

Screenshots

Screenshot 2025-08-19 at 2 59 49 PM Screenshot 2025-08-19 at 2 59 59 PM Screenshot 2025-08-19 at 3 00 41 PM Screenshot 2025-08-19 at 3 00 59 PM Screenshot 2025-08-19 at 3 01 06 PM Screenshot 2025-08-19 at 3 01 18 PM

Getting Started

Prerequisites

  • Python 3.9+
  • Node.js 18+
  • npm
  • Anthropic API key (Get one here)

Quick Setup (Recommended)

# Clone the repository
git clone https://github.com/Zakk-Fast/code-complexity-analyzer.git
cd code-complexity-analyzer

# Run the automated setup script
./setup.sh

The setup script will:

  • ✅ Check all prerequisites
  • 🐍 Create and configure Python virtual environment
  • 📦 Install all Python and Node.js dependencies
  • 🔑 Prompt for your Anthropic API key
  • 🚀 Optionally start both servers automatically

Manual Setup

If you prefer manual setup:

# Backend
cd server
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
echo "ANTHRO_API_KEY=your_api_key_here" > .env

# Frontend
cd ../client
npm install

# Run both servers
cd ../
npm run dev

API

POST /analyze - Returns structured analysis with complexity metrics and suggestions

{
  "code_text": "your code here",
  "language": "unknown",
  "file_name": "example.js"
}

Built With

Modern full-stack development, AI integration, data visualization, and professional modern UI/UX design.

Contributors

Zakk-FastAlexsanderHamir

Issues