CodeGuard

Python Code Quality Analyzer — 9 checks, 279 files, 0.58s

🐍 Python 3.8+ ⚡ 9 Built-in Checks 📦 pip install codeguard 🔧 CLI & CI ready

Install in seconds

pip install codeguard

Then run codeguard analyze src/

🔍 9 Analysis Checks

Style, Security, Performance, Complexity, Naming, Documentation, Imports, Duplication, Typing

📊 Multiple Outputs

Terminal, JSON, HTML, Markdown, CSV, XML, JUnit, SARIF, Dashboard

🔧 Auto-fix

Automatically fix common issues with --fix flag

⚡ Fast

Analyzes 279 files in under 1 second with parallel execution

🐳 CI/CD Ready

SARIF, JUnit, and JSON outputs integrate with GitHub, Jenkins, GitLab

📈 Complexity Metrics

Cyclomatic complexity, maintainability index, and more

Demo: Analyzing itself

$ codeguard analyze src/

[21:10:52] [INFO] Running 9 checks on 279 files
[21:10:52] [INFO] Analysis complete: 556 violations in 279 files (0.58s)

==========================================================
  CodeGuard Analysis Report
==========================================================
  Files analyzed:  279
  Total lines:     7157
  Duration:        0.58s
  Total violations: 556
==========================================================
  Severity Breakdown:
    high      :    5  #####
    low       :  176  ########################################
    medium    :  375  ########################################
==========================================================
  Sample Violations:
    [MEDIUM] Module missing docstring                base.py:1
    [MEDIUM] Class 'BaseCheck' missing docstring     base.py:7
    [MEDIUM] Function 'check' missing docstring      base.py:15
==========================================================

Quick Start

# Install
pip install codeguard

# Basic analysis
codeguard analyze src/

# Generate HTML report
codeguard analyze src/ --format html --output report.html

# Auto-fix issues
codeguard analyze src/ --fix

# CI-friendly JSON output
codeguard analyze src/ --format json --output results.json

# Watch mode (re-run on changes)
codeguard analyze src/ --watch