Screenshot of Upgrade Impact Analyzer - Intelligent dependency upgrade risk analysis tool that combines static code analysis, changelog inte...
lab Python CLI DevOps Static Analysis Security CI/CD Rich

Upgrade Impact Analyzer

πŸ“¦ Upgrade Impact Analyzer

Intelligent dependency upgrade risk analysis with AI-powered insights

Unlike traditional dependency checkers that just report version changes, Upgrade Impact Analyzer measures risk based on your actual code usage. It combines static code analysis, changelog intelligence, and semantic versioning to give you actionable insights.

Python 3.12+ License: MIT

🎯 Key Features

FeatureDescription
Usage-Centric ScoringRisk scored by actual code usage, not just version numbers
AI-Powered AnalysisLLM changelog summarization (OpenAI/Anthropic)
Conflict DetectionDetect incompatible upgrades before they break your code
Security ScanningCVE detection via pip-audit and OSV.dev
Health ScoringA-F grades based on maintenance, popularity, quality
SBOM GenerationCycloneDX 1.5 and SPDX 2.3 formats
License AuditingCompliance checking with deny lists
Monorepo SupportAnalyze multiple projects with shared deps
Custom PoliciesDefine risk thresholds per package
Multi-Format OutputTerminal, JSON, SARIF, JUnit XML, Markdown
CI/CD IntegrationGitHub Actions, pre-commit hooks

πŸ“₯ Installation

# Basic installation
pip install upgrade-impact-analyzer

# With security scanning support
pip install upgrade-impact-analyzer[security]

# With all optional features
pip install upgrade-impact-analyzer[all]

Available on PyPI

πŸš€ Quick Start

# Analyze your project (auto-detects files)
upgrade-analyzer analyze

# Check for conflicts before upgrading
upgrade-analyzer conflicts

# With security scanning
upgrade-analyzer analyze --security

# Generate SBOM
upgrade-analyzer sbom --output sbom.json

# Health scoring
upgrade-analyzer health

# AI-powered analysis (requires OPENAI_API_KEY)
upgrade-analyzer ai-analyze --package requests --from 2.28.0 --to 2.31.0

πŸ’‘ Advanced Usage

πŸ” Conflict Detection

Detect incompatible dependencies before upgrading (Forward, Reverse, and Cross-upgrade conflicts).

upgrade-analyzer conflicts                    # Check all upgrades
upgrade-analyzer conflicts --output conflicts.md  # Save report

πŸ€– AI-Powered Analysis

Get human-readable summaries of breaking changes using LLMs.

# Requires OPENAI_API_KEY or ANTHROPIC_API_KEY
export OPENAI_API_KEY="sk-..."

upgrade-analyzer ai-analyze \
  --package requests \
  --from 2.28.0 \
  --to 2.31.0

πŸ“Š Health Scoring & Licensing

# Show A-F grades for your dependencies
upgrade-analyzer health

# Audit licenses (pass --deny AGPL-3.0 to fail on specific licenses)
upgrade-analyzer licenses

🏒 Monorepo & Policies

# Analyze monorepo
upgrade-analyzer monorepo --root /path/to/monorepo

# Initialize custom policies
upgrade-analyzer init-policies

πŸ“Š Example Output

Terminal Output

πŸ“¦ Dependency Upgrade Analysis
┏━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━┓
┃ Package    ┃ Current ┃ Target ┃ Risk Score ┃ Severity ┃ Issues ┃
┑━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━┩
β”‚ requests   β”‚ 2.28.0  β”‚ 3.0.0  β”‚       85.0 β”‚ πŸ”΄ high  β”‚      3 β”‚
β”‚ flask      β”‚ 2.0.0   β”‚ 3.0.0  β”‚       45.0 β”‚ 🟑 mediumβ”‚      1 β”‚
β”‚ pytest     β”‚ 7.0.0   β”‚ 8.0.0  β”‚       12.0 β”‚ 🟒 low   β”‚      0 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Risk Breakdown

πŸ“¦ requests: 2.28.0 β†’ 3.0.0

β”Œβ”€ Risk Assessment ────────────────────────────┐
β”‚ πŸ”΄ HIGH                                      β”‚
β”‚ Risk Score: 85.0/100                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Risk Factors:
  β€’ SemVer Distance: [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘] 80.0 (weight: 30%)
  β€’ Usage Impact: [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] 100.0 (weight: 50%)
    3 API changes affecting 5 usage points
  β€’ Changelog Severity: [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘] 40.0 (weight: 20%)

⚠️  Breaking Changes:
  β€’ requests.get
    Function 'requests.get' signature changed
    Affects 2 usage(s) across 1 file(s)

πŸ”§ CI/CD Integration

GitHub Actions

jobs:
  analyze:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install analyzer
        run: pip install upgrade-impact-analyzer
      - name: Run analysis
        run: upgrade-analyzer analyze --format sarif --output results.sarif
      - uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: results.sarif

πŸ—οΈ Architecture

upgrade_analyzer/
β”œβ”€β”€ analyzer.py          # Main orchestrator
β”œβ”€β”€ cli.py               # Typer CLI commands
β”œβ”€β”€ conflict_detector.py # Dependency conflict detection
β”œβ”€β”€ health.py            # Health scoring (A-F)
β”œβ”€β”€ sbom.py              # SBOM & license auditing
β”œβ”€β”€ intelligence/        # Risk analysis
β”‚   β”œβ”€β”€ api_differ.py   # API diffing (griffe)
β”‚   β”œβ”€β”€ risk_scorer.py  # Risk calculation
β”‚   β”œβ”€β”€ security.py     # CVE detection
β”‚   └── llm_analyzer.py # AI analysis
└── scanner/             # Code analysis
    └── ast_analyzer.py  # AST-based usage detection

πŸ“„ License

MIT License - see LICENSE for details.