An open API service indexing awesome lists of open source software.

https://github.com/rudra496/codevista

๐Ÿ” CodeVista โ€” AI-powered code analysis & visualization tool. Understand complex codebases instantly. Dependency graphs, architecture insights & quality metrics.
https://github.com/rudra496/codevista

ci-cd code-analysis code-metrics code-quality code-review code-security code-smell developer-tools devsecops hacktoberfest html-reports linter open-source python sast security-audit software-quality static-analysis technical-debt vulnerability

Last synced: 1 day ago
JSON representation

๐Ÿ” CodeVista โ€” AI-powered code analysis & visualization tool. Understand complex codebases instantly. Dependency graphs, architecture insights & quality metrics.

Awesome Lists containing this project

README

          



Python 3.9+
MIT License
Tests
Coverage
Languages
Stars
Forks
Issues



โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•
โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘
โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘
โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘
โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•

CodeVista โ€” Code Analysis & Security Scanner


Deep analytics for your code โ€” a powerful static analysis tool



Beautiful interactive codebase visualizations โ€” single HTML, zero dependencies.

---

## โœจ What is CodeVista?

CodeVista analyzes your codebase and generates a **stunning single-page HTML report** โ€” no server, no internet, no external dependencies. Just share one file and everyone can explore your code visually.

![CodeVista Demo](https://img.shields.io/badge/๐ŸŽฌ_Demo_Screenshot-Coming_Soon-8b5cf6?style=for-the-badge)

## ๐Ÿš€ Quick Start

```bash
pip install codevista
codevista analyze ./my-project/
```

That's it. Open `report.html` in any browser. No server needed.

## ๐Ÿ“ฆ Installation

```bash
pip install codevista
```

Zero external dependencies โ€” pure Python stdlib.

## ๐ŸŽฏ Commands

| Command | Description |
|---------|-------------|
| `codevista analyze ./project/` | Full analysis with all features |
| `codevista analyze ./project/ -o report.html` | Custom output path |
| `codevista analyze ./project/ --no-git` | Skip git analysis |
| `codevista analyze ./project/ --depth 3` | Limit directory depth |
| `codevista quick ./project/` | Fast analysis (~3 seconds) |
| `codevista serve ./project/ --port 8080` | Serve report on HTTP server |
| `codevista compare ./v1/ ./v2/` | Compare two codebases |
| `codevista watch ./project/` | Re-analyze on file changes |
| `codevista smells ./project/` | Detect code smells and anti-patterns |
| `codevista architecture ./project/` | Detect architecture patterns |
| `codevista code-age ./project/` | Analyze file age, churn, and risk |
| `codevista export ./project/ -f sarif` | Export as SARIF for CI |
| `codevista export ./project/ --all` | Export to all formats |
| `codevista health ./project/` | Health score only |
| `codevista security ./project/` | Security scan only |
| `codevista deps ./project/` | Dependency analysis |
| `codevista git-stats ./project/` | Git repository statistics |
| `codevista languages ./project/` | Language distribution breakdown |
| `codevista complexity ./project/` | Complexity analysis and top functions |
| `codevista snapshot ./project/` | Save analysis snapshot for trend tracking |
| `codevista trends ./project/` | Show project health trends over time |
| `codevista diff-snapshots ./project/ 1 2` | Compare two snapshots |
| `codevista team ./project/` | Team productivity & collaboration analysis |
| `codevista ci-output ./project/ -f sarif` | CI/CD output (SARIF, Checkstyle, etc.) |
| `codevista decay ./project/` | Architectural decay analysis |
| `codevista dna ./project/` | Generate CodeDNA fingerprint |
| `codevista lint ./project/` | Language-specific lint rules |

## ๐Ÿ“Š What It Analyzes

### ๐Ÿ—๏ธ Architecture Map
- File dependency graph โ€” who imports whom
- Interactive directory tree with line counts
- Module cluster detection

### ๐Ÿ“ˆ Code Metrics
- Lines of code per file (interactive bar chart)
- Cyclomatic complexity (hot spot detection)
- Code duplication detection (hash-based)
- Comment coverage tracking
- File size distribution

### ๐Ÿงฉ Technology Detection
- Language detection (65+ languages)
- Framework detection (React, Django, Flask, Express, etc.)
- Dependency inventory with versions

### ๐Ÿฅ Health Score
- Overall health: 0-100 (composite score)
- Per-category: readability, complexity, duplication, coverage, security, dependencies
- Color-coded indicators (green/yellow/red)
- Specific improvement recommendations

### ๐Ÿ”’ Security Scan
- Hardcoded secrets (AWS, GitHub, Stripe, API keys, passwords, tokens)
- Dangerous functions (eval, exec, shell=True, pickle)
- Private key detection
- Severity scoring (critical/high/medium/low)

### ๐Ÿ‘ฅ Git Insights
- Contribution heatmap (52-week calendar)
- Top contributors with commit share
- Most active files
- Commit statistics

### ๐Ÿ‘ƒ Code Smell Detection
CodeVista detects **19 categories of code smells** that go beyond typical linters:

| Smell | Description |
|-------|-------------|
| **God Classes** | Classes with too many methods/fields/responsibilities |
| **Long Parameter Lists** | Functions with too many params, especially with `=None` |
| **Feature Envy** | Methods using another class's data more than their own |
| **Divergent Change** | Classes modified for multiple unrelated reasons |
| **Shotgun Surgery** | Single logical change requiring edits across many files |
| **Parallel Inheritance** | Adding a subclass of A always requires subclassing B |
| **Speculative Generality** | Unused abstractions, abstract methods never overridden |
| **Temporary Fields** | Instance variables set only in certain methods |
| **Message Chains** | Long dot chains: `a.b.c.d.e.f` |
| **Middle Man** | Classes that only delegate to another class |
| **Comment Smells** | Comments describing WHAT code does, not WHY |
| **Dead Code** | Variables assigned but never read, functions never called |
| **Magic Numbers** | Unnamed numeric literals scattered in code |
| **Copy-Paste Code** | Near-duplicate blocks within and across files |
| **Missing Error Handling** | I/O operations without try/catch or error checks |
| **Inconsistent Naming** | Mixing camelCase and snake_case conventions |
| **Boolean Parameters** | Flags indicating method should be split |
| **isinstance Chains** | Type checking chains suggesting missing polymorphism |

Each smell comes with severity, location, and **actionable remediation advice**.

```bash
codevista smells ./my-project/
```

### ๐Ÿ—๏ธ Architecture Pattern Detection
Automatically identifies architectural patterns from project structure and code:

- **MVC / MVVM / MVP** โ€” UI patterns
- **Layered Architecture** โ€” presentation, business, data layers
- **Clean Architecture** โ€” entities, use cases, controllers, adapters
- **Hexagonal** โ€” ports & adapters pattern
- **Repository Pattern** โ€” data access mediation
- **Service Layer** โ€” application boundary with coordinating operations
- **CQRS** โ€” command/query separation
- **Event-Driven** โ€” event publishers, subscribers, handlers
- **Microservices** โ€” independent service architecture
- **Singleton / Factory / Strategy / Observer / Decorator** โ€” design patterns
- **Dependency Injection** โ€” DI framework and manual injection

Includes architecture quality scoring (organization, coupling, modularity, balance) and text-based architecture diagrams.

```bash
codevista architecture ./my-project/
```

### ๐Ÿ“… Code Age & Risk Analysis
Track file age, change frequency, and identify files most likely to have bugs:

| Category | Description |
|----------|-------------|
| ๐Ÿ”ฅ **Hot** | Changed in the last 7 days |
| ๐ŸŒค๏ธ **Warm** | Changed in the last 30 days |
| โ„๏ธ **Cold** | Changed 30-365 days ago |
| ๐ŸงŠ **Cold Stable** | Old but few changes (stable) |
| ๐Ÿ’€ **Dead** | Unchanged for >1 year |

**Risk Analysis** correlates age ร— complexity ร— churn to identify the files most likely to contain bugs:
- Files with high age, high complexity, and high change frequency get the highest risk scores
- Statistical correlation analysis between age, complexity, and churn
- Actionable recommendations for high-risk files

```bash
codevista code-age ./my-project/
```

## ๐Ÿ“ˆ Trend Analysis

Track code quality over time with snapshots and trend visualization.

### How It Works

1. **Save snapshots** after each analysis run
2. **Compare snapshots** to see how your codebase evolves
3. **Get alerted** when metrics cross critical thresholds
4. **Track technical debt** ratio over time

```bash
# Save a snapshot of the current state
codevista snapshot ./my-project/

# Save with a label
codevista snapshot ./my-project/ --label "before-refactor"

# View trends
codevista trends ./my-project/

# Compare two specific snapshots
codevista diff-snapshots ./my-project/ 1 2
```

### ASCII Timeline Example

```
๐Ÿ“ˆ Health Score Timeline
100 โ”คโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
โ”‚โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
โ”‚โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
โ”‚โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
โ”‚โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
โ”‚โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
โ”‚โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
โ”‚โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
โ”‚โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
โ”‚โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
โ”‚โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
โ”‚โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
0 โ”คโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Current: 78/100 โ†‘
```

### Features

- **Trend arrows**: โ†‘ improving, โ†“ degrading, โ†’ stable
- **Threshold alerts**: Get warned when health drops or security issues spike
- **Technical debt tracking**: Monitor debt ratio over time
- **Review cadence**: Suggests optimal review frequency based on change rate
- **Code age distribution**: Track how your codebase ages

## ๐Ÿ‘ฅ Team Metrics

Analyze developer productivity and collaboration patterns.

```bash
codevista team ./my-project/
```

### What It Analyzes

| Metric | Description |
|--------|-------------|
| **Lines per Author** | Added/removed/net per developer |
| **Commit Frequency** | Commits per day, burst vs steady patterns |
| **Files Touched** | Unique files per author |
| **Bus Factor** | People needed to understand 50% of code |
| **Code Ownership** | Pie chart data showing contribution share |
| **Review Coverage** | Estimate from commit messages |
| **Pair Programming** | Co-authored commit detection |
| **Time Zone Distribution** | When the team commits |
| **Onboarding Complexity** | How hard for a new contributor to ramp up |

### ๐Ÿš๏ธ Architectural Decay Detector
Track how your codebase degrades over time using git history. Detects growing complexity, increasing coupling, code duplication, and predicts future state.

```bash
codevista decay ./my-project/
```

**What it analyzes:**

| Metric | Description |
|--------|-------------|
| **Complexity Growth** | How cyclomatic complexity changes across commits |
| **Coupling Growth** | How module interdependencies grow over time |
| **Duplication Growth** | Code duplication ratio changes |
| **Debt Velocity** | Technical debt accumulation rate per week |
| **Decay Hotspots** | Files degrading fastest (ranked by decay score) |
| **Predictions** | Linear regression forecasts for 12 weeks ahead |
| **Inflection Points** | Key commits where quality shifted significantly |
| **Interventions** | Prioritized refactoring recommendations |

**ASCII Report Example:**

```
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘ ๐Ÿš๏ธ ARCHITECTURAL DECAY ANALYSIS โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘ Repository: my-project โ•‘
โ•‘ Is Git: Yes โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐Ÿ“ˆ COMPLEXITY GROWTH
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
2026-01-15 avg CC: 8.2 [โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]
2026-02-01 avg CC: 9.5 [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]
2026-02-15 avg CC: 11.3 [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]
2026-03-01 avg CC: 13.8 [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘]
Trend: ๐Ÿ“ˆ GROWING

๐Ÿ”ฅ DECAY HOTSPOTS (top 10)
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
๐Ÿ”ด 1. 45.2 [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘] src/core/engine.py
๐ŸŸ  2. 28.7 [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] src/api/handler.js
๐ŸŸก 3. 12.4 [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘] src/utils/parser.py

๐Ÿ”ฎ PREDICTIONS (12 weeks forward)
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Avg complexity: 18.5
Debt lines: 2450
Confidence: moderate

๐Ÿ’ก RECOMMENDED INTERVENTIONS
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
๐Ÿ”ด [CRITICAL] src/core/engine.py
Action: refactor
break into smaller functions/modules; stabilize โ€” changes are volatile
```

### ๐Ÿงฌ CodeDNA Fingerprinter
Create unique DNA fingerprints for codebases โ€” identify projects, detect forks, spot cloned code.

```bash
# Generate fingerprint with ASCII barcode
codevista dna ./my-project/

# Save fingerprint for later comparison
codevista dna ./my-project/ --save fingerprint.json

# Compare two projects
codevista dna ./project-a/ --compare fingerprint.json

# Detect cloned files
codevista dna ./my-project/ --clones
```

**What it captures:**

| Component | Description |
|-----------|-------------|
| **Hash Patterns** | SHA-based profile of code structure patterns |
| **Language Distribution** | Language mix signature |
| **Complexity Distribution** | Complexity bucket fingerprint |
| **Dependency Topology** | Import graph topology hash |
| **Naming Conventions** | camelCase/snake_case/PascalCase ratios |
| **Comment Density** | Documentation coverage fingerprint |
| **Function Size** | Function size distribution |
| **File Size** | File size distribution |
| **Clone Detection** | Exact and near-clone detection via block hashing |

**Barcode Example:**

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ ๐Ÿงฌ CodeDNA Barcode โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ โ–“โ–“โ–’โ–’โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–“โ–’โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–’โ–’โ–“โ–“โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–’โ–’โ–“โ–“โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–’โ–’โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ”‚
โ”‚ โ–ˆโ–ˆโ–“โ–“โ–‘โ–‘โ–’โ–’โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–“โ–“โ–ˆโ–ˆโ–’โ–’โ–‘โ–‘โ–“โ–“โ–’โ–’โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–“โ–“โ–ˆโ–ˆโ–’โ–’โ–‘โ–‘โ–“โ–“โ–’โ–’โ–‘โ–‘โ–‘โ”‚
โ”‚ โ–‘โ–‘โ–’โ–’โ–ˆโ–ˆโ–“โ–“โ–‘โ–‘โ–’โ–’โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–“โ–“โ–ˆโ–ˆโ–’โ–’โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–“โ–“โ–‘โ–‘โ–’โ–’โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–“โ–“โ–ˆโ–ˆโ–“โ–“โ”‚
โ”‚ โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–“โ–“โ–’โ–’โ–ˆโ–ˆโ–“โ–“โ–‘โ–‘โ–’โ–’โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–“โ–“โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–’โ–’โ–ˆโ–ˆโ–“โ–“โ–‘โ–‘โ–’โ–’โ–‘โ–‘โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Project: my-project files: 42โ”‚
โ”‚ Languages: Python 45.2%, JS 30.1%, HTML 15.3% โ”‚
โ”‚ Naming: snake_case โ”‚
โ”‚ Hash: a3f7c2b1e9d04586 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Compact: [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘]
a3f7c2b1e9d045867f2a9c3d1e8b4f6a...
```

## ๐Ÿ“ Lint Rules

CodeVista includes **36 language-specific lint rules** across 5 languages, enforcing popular style guides:

```bash
# Lint entire project
codevista lint ./my-project/

# Lint specific file
codevista lint ./src/app.py

# Filter by language
codevista lint ./project/ -l python -l javascript

# Filter by severity
codevista lint ./project/ -s error -s warning

# Include/exclude specific rules
codevista lint ./project/ --include-rule PY001 --exclude-rule PY010

# JSON output for CI
codevista lint ./project/ --json

# List all available rules
codevista lint --rules
```

### Supported Languages & Rules

| Language | Style Guide | Rules | Severity |
|----------|------------|-------|----------|
| **Python** | PEP 8 / Black | PY001โ€“PY011 (11 rules) | error/warning/info |
| **JavaScript** | Airbnb | JS001โ€“JS009 (9 rules) | error/warning/info |
| **TypeScript** | Airbnb (shared) | JS001โ€“JS009 (9 rules) | error/warning/info |
| **Go** | gofmt | GO001โ€“GO005 (5 rules) | error/warning |
| **Rust** | clippy-lite | RS001โ€“RS005 (5 rules) | error/warning/info |
| **Java** | Google Style | JA001โ€“JA006 (6 rules) | error/warning/info |

### Python (PEP 8 / Black)

| Rule | Severity | Description |
|------|----------|-------------|
| PY001 | warning | Max line length (88 for Black) |
| PY002 | error | No wildcard imports (`from x import *`) |
| PY003 | info | Import order: stdlib โ†’ third-party โ†’ local, alphabetized |
| PY004 | info | Two blank lines before top-level definitions |
| PY005 | info | One blank line before methods |
| PY006 | info | Spaces around operators |
| PY007 | info | Prefer f-strings over `.format()` / %-formatting |
| PY008 | info | Type hints on public functions |
| PY009 | warning | Naming conventions (snake_case, PascalCase, UPPER_CASE) |
| PY010 | info | No trailing whitespace |
| PY011 | warning | No multiple statements on one line |

### JavaScript/TypeScript (Airbnb)

| Rule | Severity | Description |
|------|----------|-------------|
| JS001 | error | No `var` โ€” use `const` or `let` |
| JS002 | info | Prefer template literals over string concatenation |
| JS003 | info | Use arrow functions for callbacks |
| JS004 | warning | Use `===` instead of `==` |
| JS005 | warning | 2-space indentation (no tabs) |
| JS006 | warning | No unused variables |
| JS007 | info | Prefer destructuring for repeated property access |
| JS008 | info | Use object shorthand syntax |
| JS009 | info | Trailing comma conventions |

### Go (gofmt)

| Rule | Severity | Description |
|------|----------|-------------|
| GO001 | error | Tab indentation required |
| GO002 | error | No unused imports |
| GO003 | warning | Exported names must have doc comment |
| GO004 | error | Error handling โ€” do not discard errors |
| GO005 | warning | No variable shadowing in inner scopes |

### Rust (clippy-lite)

| Rule | Severity | Description |
|------|----------|-------------|
| RS001 | error | No `.unwrap()` in production code |
| RS002 | warning | Use Option/Result properly (no `is_some().unwrap()`) |
| RS003 | error | No mutable statics |
| RS004 | info | Lint suppressions should be avoided |
| RS005 | error | Naming conventions (snake_case functions/vars) |

### Java (Google Style)

| Rule | Severity | Description |
|------|----------|-------------|
| JA001 | error | 4-space indentation (no tabs) |
| JA002 | warning | Javadoc on public methods |
| JA003 | error | No wildcard imports |
| JA004 | error | Braces required for control statements |
| JA005 | warning | Catch specific exceptions |
| JA006 | info | Use logger instead of `System.out.print` |

### Exit Codes

| Code | Meaning |
|------|---------|
| `0` | Clean โ€” no violations |
| `2` | Errors found |

## ๐Ÿ“ค Export Formats

Export analysis results in multiple formats for different use cases:

| Format | Use Case | Command |
|--------|----------|---------|
| **HTML** | Interactive report in browser | `codevista export . -f html` |
| **JSON** | Programmatic access, APIs | `codevista export . -f json` |
| **Markdown** | Documentation, READMEs, wikis | `codevista export . -f markdown` |
| **SARIF** | GitHub Code Scanning, CI/CD | `codevista export . -f sarif` |
| **CSV** | Spreadsheets, data analysis | `codevista export . -f csv` |
| **YAML** | CODE_METRICS format | `codevista export . -f yaml` |
| **PDF** | Printable reports | `codevista export . -f pdf` |
| **All formats** | Everything at once | `codevista export . --all` |

```bash
# CI integration with GitHub Code Scanning
codevista export ./project/ -f sarif -o results.sarif.json

# Export everything
codevista export ./project/ -o ./reports/codevista --all
```

## ๐Ÿ”Œ CI/CD Integration

CodeVista provides dedicated CI output formats with threshold-based pass/fail.

### Supported Formats

| Format | Platform | Command |
|--------|----------|---------|
| **SARIF** | GitHub Code Scanning | `codevista ci-output . -f sarif` |
| **GitLab Code Quality** | GitLab | `codevista ci-output . -f gitlab` |
| **Checkstyle XML** | Jenkins, GitHub Actions | `codevista ci-output . -f checkstyle` |
| **JUnit XML** | Any CI with JUnit support | `codevista ci-output . -f junit` |
| **Markdown** | PR comments | `codevista ci-output . -f markdown` |
| **Terminal** | Quick terminal output | `codevista ci-output . -f terminal` |

### Exit Codes

| Code | Meaning | Description |
|------|---------|-------------|
| `0` | Clean | All thresholds passed |
| `1` | Warnings | Medium-severity threshold violations |
| `2` | Errors | High-severity violations (health, complexity) |
| `3` | Critical | Critical security issues or severe degradation |

### Threshold Configuration

Create `.codevista.json` in your project root:

```json
{
"max_security_critical": 0,
"max_security_high": 0,
"max_security_medium": 5,
"max_security_total": 10,
"max_avg_complexity": 10,
"max_technical_debt_ratio": 0.25,
"min_health_score": 60,
"max_duplicates": 10,
"max_circular_deps": 0,
"max_todo_count": 50
}
```

```bash
# Run with exit codes (CI will fail if thresholds violated)
codevista ci-output ./project/ -f sarif -o results.sarif.json
echo "Exit code: $?" # 0=clean, 1=warnings, 2=errors, 3=critical
```

## ๐Ÿณ Docker

```bash
# Build
docker build -t codevista .

# Analyze a project
docker run --rm -v $(pwd):/workspace codevista analyze /workspace

# Use docker-compose
docker-compose up
```

The Docker image uses multi-stage builds for minimal size, runs as non-root, and includes `wkhtmltopdf` for PDF export.

## ๐ŸŽจ Report Features

- **Single HTML file** โ€” share anywhere, works offline forever
- **Dark/light mode** toggle
- **Interactive tables** โ€” sort by any column, filter by language, search
- **Inline SVG charts** โ€” no external JS libraries
- **Collapsible sections**
- **Print-friendly**
- **Responsive** โ€” works on mobile

## ๐Ÿ† Comparison

| Feature | CodeVista | SonarQube | CodeClimate | lizard |
|---------|-----------|-----------|-------------|--------|
| Setup | `pip install` | Docker/Server | SaaS / CLI | `pip install` |
| Dependencies | **Zero** | Heavy (Java + DB) | Docker (CLI) | None |
| Output | **Single HTML** | Web UI | Web UI | CLI text |
| Offline | โœ… | โŒ | โŒ | โœ… |
| Security scan | โœ… 60+ patterns | โœ… extensive | โœ… plugins | โŒ |
| Git analysis | โœ… | โœ… | โœ… | โŒ |
| Visual charts | โœ… inline SVG | โœ… | โœ… | โŒ |
| Code smell detection | โœ… 19 categories | โœ… extensive | โœ… maintainability | โŒ |
| Architecture patterns | โœ… **12+ patterns** | โŒ | โŒ | โŒ |
| Code age analysis | โœ… | Partial | โŒ | โŒ |
| SARIF export | โœ… | โœ… | โŒ | โŒ |
| Cost | **Free** | Free/Paid | Paid | Free |
| Server needed | **No** | Yes | Yes | No |

> **Note:** SonarQube and CodeClimate are mature enterprise tools with deeper language coverage and IDE integrations. CodeVista differentiates by being zero-setup, offline-capable, and producing shareable single-file HTML reports โ€” ideal for quick audits, CI pipelines, and open-source projects.

## ๐Ÿ’Ž What Makes CodeVista Unique

1. **Zero dependencies** โ€” pure Python stdlib, no pip install headaches
2. **Single HTML output** โ€” share one file, works offline forever, no server
3. **Code smell detection** โ€” 19 smell categories with AST-level Python analysis
4. **Architecture pattern detection** โ€” identifies 12+ patterns from structure + code
5. **Code age ร— risk correlation** โ€” statistical analysis of age, complexity, and churn
6. **Multi-format export** โ€” HTML, JSON, Markdown, SARIF, CSV, YAML, PDF
7. **Docker support** โ€” multi-stage build, non-root user, PDF-ready
8. **Beautiful design** โ€” dark mode, glassmorphism, inline SVG charts, animations
9. **Works on any codebase** โ€” 65+ languages, no configuration needed
10. **CI/CD ready** โ€” SARIF export for GitHub Code Scanning integration

## ๐Ÿ—๏ธ Architecture

```
codevista/
โ”œโ”€โ”€ cli.py # CLI interface (argparse)
โ”œโ”€โ”€ analyzer.py # Core analysis engine
โ”œโ”€โ”€ report.py # HTML report generator
โ”œโ”€โ”€ metrics.py # Health scores & recommendations
โ”œโ”€โ”€ smells.py # Code smell detection (19 categories)
โ”œโ”€โ”€ architecture.py # Architecture pattern detector
โ”œโ”€โ”€ code_age.py # Code age & risk analysis
โ”œโ”€โ”€ export.py # Multi-format export (HTML/JSON/MD/SARIF/CSV/YAML/PDF)
โ”œโ”€โ”€ security.py # Secret/vulnerability scanning
โ”œโ”€โ”€ dependencies.py # Dependency parsing & analysis
โ”œโ”€โ”€ git_analysis.py # Git stats extraction
โ”œโ”€โ”€ trends.py # Trend analysis & snapshot tracking
โ”œโ”€โ”€ team.py # Team metrics & collaboration analysis
โ”œโ”€โ”€ integrations.py # CI/CD output (SARIF, Checkstyle, JUnit, GitLab)
โ”œโ”€โ”€ decay.py # Architectural decay detector
โ”œโ”€โ”€ codedna.py # CodeDNA fingerprinter
โ”œโ”€โ”€ lint_rules.py # Language-specific lint rules (PEP 8, Airbnb, gofmt, clippy, Google)
โ”œโ”€โ”€ languages.py # Language definitions & colors
โ”œโ”€โ”€ config.py # Configuration & ignore patterns
โ”œโ”€โ”€ utils.py # Utilities & color schemes
โ””โ”€โ”€ templates/ # HTML templates
```

## ๐Ÿ› ๏ธ Tech Stack

- **Python 3.9+** (stdlib only)
- **Inline SVG** for all charts
- **CSS custom properties** for theming
- **Vanilla JavaScript** for interactivity
- **AST parsing** for deep code analysis (Python)

## ๐Ÿค Contributing

1. Fork it
2. Create your feature branch (`git checkout -b feature/amazing`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing`)
5. Open a Pull Request

## โญ Star History





Star History

## ๐Ÿ“„ License

MIT ยฉ 2026 โ€” see [LICENSE](LICENSE)

## ๐Ÿ’ก Why CodeVista?

- **Zero dependencies** โ€” Pure Python, no Node.js, no databases, no external tools
- **65+ languages** โ€” Works with virtually any codebase out of the box
- **Stunning HTML reports** โ€” Beautiful, interactive reports you'll actually want to read
- **Security-first** โ€” 60+ secret detection patterns including Stripe, AWS, GitHub tokens
- **Unique features** โ€” CodeDNA fingerprinting and architectural decay detection (no other tool has this)
- **CI/CD ready** โ€” SARIF, Checkstyle, and JUnit XML output formats

## ๐Ÿ‘ฅ Use Cases

| Use Case | How |
|----------|-----|
| **Individual Developers** | Get a health score for your project, find security issues |
| **Engineering Teams** | Track code quality trends, compare team member metrics |
| **CI/CD Pipelines** | Generate SARIF reports for GitHub Code Scanning |
| **Open Source Maintainers** | Analyze PR quality, detect code smells automatically |
| **Code Reviews** | Get automated feedback on architecture, complexity, and duplication |
| **Education** | Teach code quality concepts with visual, interactive reports |

## ๐Ÿ”— Other Projects

Check out more open-source tools:

| Project | Description | Stars |
|---------|-------------|-------|
| [๐Ÿ›ก๏ธ AI Code Trust Validator](https://github.com/rudra496/ai-code-trust-validator) | Detect security flaws, hallucinations & logic errors in AI-generated code | ![Stars](https://img.shields.io/github/stars/rudra496/ai-code-trust-validator?style=social) |
| [๐Ÿค– TermMind](https://github.com/rudra496/termmind) | AI-powered terminal assistant with 7 providers | ![Stars](https://img.shields.io/github/stars/rudra496/termmind?style=social) |

---

## ๐ŸŒ Connect

- [![GitHub](https://img.shields.io/badge/GitHub-rudra496-181717?logo=github)](https://github.com/rudra496)
- [![LinkedIn](https://img.shields.io/badge/LinkedIn-rudrasarker-0A66C2?logo=linkedin)](https://www.linkedin.com/in/rudrasarker)
- [![X/Twitter](https://img.shields.io/badge/X-@Rudra496-000000?logo=x)](https://x.com/Rudra496)
- [![Facebook](https://img.shields.io/badge/Facebook-rudrasarker130-1877F2?logo=facebook)](https://www.facebook.com/rudrasarker130)
- [![YouTube](https://img.shields.io/badge/YouTube-@rudrasarker9732-FF0000?logo=youtube)](https://youtube.com/@rudrasarker9732)
- [![Dev.to](https://img.shields.io/badge/Dev.to-rudra__sarker-000000?logo=devdotto)](https://dev.to/rudra_sarker)
- [![ResearchGate](https://img.shields.io/badge/ResearchGate-Rudra_Sarker-00CCBB?logo=researchgate)](https://www.researchgate.net/profile/Rudra-Sarker-3)

---


Built with โค๏ธ by rudra496 ยท LinkedIn

MIT License ยท Free & Open Source Forever

---

## More Open Source Projects

| Project | Stars | Description |
|---------|-------|-------------|
| [StealthHumanizer](https://github.com/rudra496/StealthHumanizer) | ![Stars](https://img.shields.io/github/stars/rudra496/StealthHumanizer?style=social) | Free AI text humanizer โ€” 13 providers, no login |
| [EdgeBrain](https://github.com/rudra496/EdgeBrain) | ![Stars](https://img.shields.io/github/stars/rudra496/EdgeBrain?style=social) | Edge AI inference โ€” sub-100ms, no cloud |
| [DevRoadmaps](https://github.com/rudra496/devroadmaps) | ![Stars](https://img.shields.io/github/stars/rudra496/devroadmaps?style=social) | 17 career paths, 1700+ free resources |
| [Nexus Agent](https://github.com/rudra496/nexus-agent) | ![Stars](https://img.shields.io/github/stars/rudra496/nexus-agent?style=social) | Self-evolving local AI agent framework |
| [MindWell](https://github.com/rudra496/mindwell) | ![Stars](https://img.shields.io/github/stars/rudra496/mindwell?style=social) | Free mental health support platform |
| [ScienceLab 3D](https://github.com/rudra496/sciencelab3d) | ![Stars](https://img.shields.io/github/stars/rudra496/sciencelab3d?style=social) | 40+ virtual STEM experiments |
| [SightlineAI](https://github.com/rudra496/sightlineai) | ![Stars](https://img.shields.io/github/stars/rudra496/sightlineai?style=social) | AI smart glasses for the blind |

---

**[โญ Star this repo](../../stargazers) ยท [๐Ÿด Fork it](../../fork) ยท [๐Ÿ‘ค Follow @rudra496](https://github.com/rudra496)**

## Connect

- [![GitHub](https://img.shields.io/badge/GitHub-rudra496-181717?logo=github)](https://github.com/rudra496)
- [![LinkedIn](https://img.shields.io/badge/LinkedIn-rudrasarker-0A66C2?logo=linkedin)](https://www.linkedin.com/in/rudrasarker)
- [![X/Twitter](https://img.shields.io/badge/X-@Rudra496-000000?logo=x)](https://x.com/Rudra496)
- [![YouTube](https://img.shields.io/badge/YouTube-@rudrasarker9732-FF0000?logo=youtube)](https://youtube.com/@rudrasarker9732)
- [![Dev.to](https://img.shields.io/badge/Dev.to-rudra__sarker-000000?logo=devdotto)](https://dev.to/rudra_sarker)