██████╗ ██████╗ ██████╗ ███████╗    █████╗ ███╗   ██╗ █████╗ ██╗   ██╗   ██╗ ███████╗███████╗██████╗ 
  ██╔════╝██╔═══██╗██╔══██╗██╔════╝   ██╔══██╗████╗  ██║██╔══██╗██║   ╚██╗ ██╔╝ ╚══███╔╝██╔════╝██╔══██╗
  ██║     ██║   ██║██║  ██║█████╗     ███████║██╔██╗ ██║███████║██║    ╚████╔╝    ███╔╝ █████╗  ██████╔╝
  ██║     ██║   ██║██║  ██║██╔══╝     ██╔══██║██║╚██╗██║██╔══██║██║      ██╔╝    ███╔╝  ██╔══╝  ██╔══██╗
  ╚██████╗╚██████╔╝██████╔╝███████╗██╗██║  ██║██║ ╚████║██║  ██║███████╗ ██║    ███████╗███████╗██║  ██║
   ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝╚═╝  ╚═╝╚═╝  ╚═══╝╚═╝  ╚═╝╚══════╝ ╚═╝    ╚══════╝╚══════╝╚═╝  ╚═╝
Code Analyzer 🛡️ is an open-source command-line tool designed to help developers and security professionals analyze code repositories for vulnerabilities 🐛 and bugs. By leveraging the power of AI 🤖 through the DeepSeek API, it provides detailed insights and recommendations to improve code quality and security.
Version: 0.2.x 🚀
You can support this project by becoming a sponsor on GitHub! Become a Sponsor
- 📦 Installation
- 🕵️ Usage
- ⚙️ CI/CD Integration
- 🤝 Contributing
- ⚖️ License
- 🐍 Python 3.6 or higher
- 🔑 A DeepSeek API key (obtainable from DeepSeek)
pip install code-analyzercode_analyzer setupThe key will be saved in ~/.code_analyzer/config.ini 🔒
Public repo:
code_analyzer analyze https://github.com/user/repoPrivate repo 🔐:
code_analyzer analyze https://github.com/user/private-repo --git-token YOUR_TOKENcode_analyzer analyze /path/to/local/repoCurrent directory 🔄:
code_analyzer analyze .- -o, --output FILE💾: Save report (- .txt,- .md,- .html,- .json,- .sarif)
- -f, --format FORMAT🎨: Output format
- --verbose📢: Debugging output
- --no-details🚫: Minimal report
- --lang LANG🌍: Language support
- --no-stream🤐: Silent mode
Example 🧪:
code_analyzer analyze . --output report.sarif --format sarif --no-stream --lang uzname: Code Analysis
on: [push, pull_request]
jobs:
  analyze:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code 
      uses: actions/checkout@v4
    
    - name: Set up Python 
      uses: actions/setup-python@v5
    
    - name: Install code-analyzer 
      run: pip install code-analyzer-b
    
    - name: Configure API key 
      env:
        DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
      run: mkdir -p ~/.code_analyzer && echo "[DEEPSEEK]\nAPI_KEY = $DEEPSEEK_API_KEY" > ~/.code_analyzer/config.ini
    
    - name: Run analysis 
      run: code_analyzer analyze . --output report.sarif --format sarif --no-stream --lang en
    
    - name: Upload SARIF 
      uses: github/codeql-action/upload-sarif@v3- 🍴 Fork the repo
- 🌱 Create a feature branch
- 📤 Open a PR
Found an issue? 🐛 Open an issue
MIT License - see LICENSE 📜