Skip to content

CodePulse is an intelligent GitHub repository analyzer that monitors the vital signs of your codebase, providing real-time insights into code health, quality, and performance. Like a medical monitor tracks a patient's pulse, CodePulse continuously evaluates your repository's heartbeat to ensure optimal code vitality.

Notifications You must be signed in to change notification settings

papai0709/CodePulse

Repository files navigation

CodePulse - AI-Enhanced GitHub Repository Analyzer οΏ½

A comprehensive, intelligent tool that analyzes GitHub repositories for test coverage, code quality, security, and performance. Now featuring AI-powered insights for deeper analysis and intelligent recommendations!

✨ Features

πŸ“Š Standard Analysis

  • Repository Analysis: Deep analysis of both public and private GitHub repositories
  • Test Coverage: Automated test case coverage analysis with multiple language support
  • Issue Detection: Identifies main issues and suggests corrective actions
  • Interactive Dashboard: Web-based interface with public/private repository selection
  • Improvement Suggestions: Detailed recommendations for code quality enhancement
  • No Token Required: Analyze public repositories without authentication

🧠 AI-Enhanced Analysis

  • Intelligent Code Review: Context-aware analysis beyond simple pattern matching
  • Smart Security Analysis: Advanced vulnerability detection using AI reasoning
  • Architecture Assessment: AI-powered evaluation of code structure and complexity
  • Performance Optimization: Intelligent suggestions for algorithmic improvements
  • Automated Documentation: Missing docs detection with AI-generated suggestions
  • Strategic Roadmap: AI-generated implementation timeline with priority matrix
  • Confidence Scoring: AI provides reliability scores for all recommendations

πŸš€ Quick Start

Easy Setup with Scripts

Initial Setup (First Time)

# Run the setup script to configure the environment
./scripts/deployment/setup.sh

Linux/Mac

# Start the application
./scripts/deployment/start_app.sh

# Stop the application  
./scripts/deployment/stop_app.sh

# Monitor application logs
./scripts/deployment/monitor_logs.sh

Windows

# Start the application
scripts\deployment\start_app.bat

# Stop the application
scripts\deployment\stop_app.bat

🐳 Docker Deployment (Recommended)

Super Quick Start

# Start CodePulse with Docker (from project root)
./docker-quick.sh

# View logs
./docker-quick.sh logs

# Stop application
./docker-quick.sh stop

Advanced Docker Management

# Production mode
./docker/docker-manage.sh run

# Development mode  
./docker/docker-manage.sh dev

# Check status
./docker/docker-manage.sh status

# Or use Docker Compose directly
cd docker && docker compose up -d

Docker Requirements

  • Docker Engine 20.10+
  • Docker Compose 2.0+
  • 2GB RAM minimum

Docker Features

  • βœ… Production Ready: Optimized containers with health checks
  • βœ… Development Mode: Live code reloading for development
  • βœ… Security: Non-root execution, isolated networks
  • βœ… Monitoring: Built-in logging and health monitoring
  • βœ… Scalability: Easy horizontal scaling with compose

πŸ“– Full Docker Documentation: docker/README.md

Manual Installation

  1. Install Dependencies:

    pip install -r requirements.txt
  2. Run the Application:

    python app.py
  3. Access Dashboard: Open http://localhost:5050 in your browser

Enable AI Features (Optional)

  1. Set Up GitHub Token (Required for AI features):

    cp .env.example .env
    # Edit .env and add your GitHub token
    GITHUB_TOKEN=your_github_token_here
  2. Restart Application:

    python app.py
  3. Enable AI Analysis:

    • Check "Enable AI-Enhanced Analysis" in the web interface
    • Experience intelligent insights and recommendations!
    python app_enhanced.py
  4. Enable AI Analysis:

    • Visit http://localhost:5050
    • Check "Enable AI-Enhanced Analysis" option
    • Experience intelligent insights!

πŸ“Š Usage

Standard Analysis

  1. Enter a GitHub repository URL in the dashboard
  2. Check "This is a public repository" for public repos (no token needed)
  3. Uncheck for private repositories (requires GitHub token in .env)
  4. Click "Analyze Repository"
  5. View comprehensive test coverage analysis and basic recommendations

AI-Enhanced Analysis

  1. Ensure you have a GitHub token configured in .env
  2. Enter a repository URL
  3. Enable "AI-Enhanced Analysis" checkbox
  4. Click "AI-Enhanced Analysis" button
  5. Get intelligent insights including:
    • Context-aware code quality assessment
    • AI-powered security vulnerability analysis
    • Performance optimization suggestions
    • Strategic improvement roadmap
    • ROI projections for improvements

πŸ—οΈ Project Structure

β”œβ”€β”€ app.py                           # Unified Flask application with AI features
β”œβ”€β”€ config.py                       # Configuration settings
β”œβ”€β”€ requirements.txt                # Python dependencies
β”œβ”€β”€ .env                           # Environment variables (create this)
β”œβ”€β”€ analyzer/                      # Core analysis modules
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ github_client.py           # GitHub API client
β”‚   β”œβ”€β”€ test_analyzer.py           # Test coverage analysis
β”‚   β”œβ”€β”€ issue_detector.py          # Issue detection logic
β”‚   β”œβ”€β”€ report_generator.py        # Standard report generation
β”‚   β”œβ”€β”€ ai_analyzer.py             # 🧠 AI analysis engine
β”‚   └── enhanced_report_generator.py # πŸš€ AI-enhanced reporting
β”œβ”€β”€ templates/                     # HTML templates
β”‚   β”œβ”€β”€ base.html
β”‚   β”œβ”€β”€ index.html                 # Main dashboard with AI toggle
β”‚   β”œβ”€β”€ results.html              # Standard analysis results
β”‚   β”œβ”€β”€ results_enhanced.html     # 🎨 AI-enhanced results page
β”‚   └── ...
β”œβ”€β”€ static/                       # Static assets
β”‚   β”œβ”€β”€ css/
β”‚   β”‚   └── style.css            # Enhanced styling
β”‚   └── js/
β”‚       └── main.js              # Interactive features
β”œβ”€β”€ scripts/                      # Utility scripts
β”‚   β”œβ”€β”€ test_ai_compatibility.py  # AI feature testing
β”‚   └── test_app.py               # Application testing
β”œβ”€β”€ tests/                        # Test suite
└── docs/                         # Documentation
    β”œβ”€β”€ AI_ENHANCEMENT_SUMMARY.md
    └── PROJECT_STRUCTURE.md

πŸ”§ Configuration

Environment Variables

Create a .env file from the example:

cp .env.example .env

Required for AI features:

# GitHub Personal Access Token
GITHUB_TOKEN=your_github_token_here

# Optional settings
DEBUG=True
SECRET_KEY=your-secret-key

GitHub Token Setup

  1. Go to GitHub Settings: https://github.com/settings/tokens
  2. Generate new token with these scopes:
    • repo (for private repositories)
    • public_repo (for public repositories)
  3. Copy token to your .env file

πŸ€– AI Models Supported

Model Use Case Cost Quality
gpt-4.1-mini General analysis (default) Low High
gpt-4.1 Comprehensive analysis Medium Very High
codestral-2501 Code-specific tasks Low High
o1-mini Complex reasoning High Very High

πŸ“ˆ Analysis Comparison

Feature Standard AI-Enhanced
Speed Fast Moderate
Depth Basic patterns Deep understanding
Accuracy Good Excellent
Recommendations Generic Tailored
Roadmap Basic Strategic
Cost Free $0.10-10.00/analysis

🎯 Examples

Standard Output

βœ… Test Coverage: 75%
⚠️  Security Issues: 3 found
πŸ“ Documentation: Missing in 12 files

AI-Enhanced Output

🧠 AI Quality Score: 82/100
🚨 Critical: SQL injection in auth/login.py (2-4 hours fix)
⚑ Performance: Implement Redis caching (15% speed improvement)
πŸ“‹ Roadmap: 4-phase improvement plan (6 months)
πŸ’° ROI: 25% development velocity increase

πŸ“š Documentation

  • AI Improvements Guide: Comprehensive AI enhancement documentation
  • API Documentation: REST API reference
  • Contributing Guidelines: How to contribute to the project β”‚ └── results.html β”œβ”€β”€ static/ # CSS, JS, and assets β”‚ β”œβ”€β”€ css/ β”‚ β”œβ”€β”€ js/ β”‚ └── images/ └── tests/ # Unit tests β”œβ”€β”€ init.py β”œβ”€β”€ test_github_client.py β”œβ”€β”€ test_analyzer.py └── test_issue_detector.py

## Usage

1. Enter a GitHub repository URL in the dashboard
2. View comprehensive test coverage analysis
3. Review identified issues and improvement areas
4. Follow suggested corrective actions

## Development

To run tests:
```bash
pytest tests/ --cov=analyzer

To run in development mode:

export FLASK_ENV=development
python app.py

License

MIT License# CodePulse

About

CodePulse is an intelligent GitHub repository analyzer that monitors the vital signs of your codebase, providing real-time insights into code health, quality, and performance. Like a medical monitor tracks a patient's pulse, CodePulse continuously evaluates your repository's heartbeat to ensure optimal code vitality.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published