Metadata-Version: 2.4
Name: code-quality-intelligence
Version: 1.6.2
Summary: AI-powered code quality analysis tool with GitHub integration and interactive chatbot
Home-page: https://github.com/suvraadeep/Code-Quality-Intelligence-Agent
Author: Suvraadeep Das
Author-email: Suvraadeep Das <suvraadeep.das@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/suvraadeep/Code-Quality-Intelligence-Agent
Project-URL: Bug Reports, https://github.com/suvraadeep/Code-Quality-Intelligence-Agent/issues
Project-URL: Source Code, https://github.com/suvraadeep/Code-Quality-Intelligence-Agent
Project-URL: Documentation, https://github.com/suvraadeep/Code-Quality-Intelligence-Agent#readme
Keywords: code quality,static analysis,AI,LLM,security,complexity,GitHub,chatbot
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Testing
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: langchain==0.2.16
Requires-Dist: langchain-groq==0.1.9
Requires-Dist: langchain-community==0.2.16
Requires-Dist: click==8.1.7
Requires-Dist: rich==13.7.1
Requires-Dist: gitpython==3.1.43
Requires-Dist: requests==2.31.0
Requires-Dist: python-dotenv==1.0.1
Requires-Dist: bandit==1.7.5
Requires-Dist: radon==6.0.1
Requires-Dist: safety==3.2.7
Requires-Dist: pygments==2.17.2
Requires-Dist: pathspec==0.12.1
Requires-Dist: tqdm==4.66.2
Provides-Extra: full
Requires-Dist: streamlit==1.31.0; extra == "full"
Requires-Dist: pandas==2.2.0; extra == "full"
Requires-Dist: matplotlib==3.8.4; extra == "full"
Requires-Dist: plotly==5.19.0; extra == "full"
Requires-Dist: seaborn==0.13.2; extra == "full"
Requires-Dist: altair==5.2.0; extra == "full"
Provides-Extra: rag
Requires-Dist: chromadb==0.4.22; extra == "rag"
Requires-Dist: sentence-transformers==2.2.2; extra == "rag"
Requires-Dist: tiktoken==0.5.2; extra == "rag"
Requires-Dist: faiss-cpu==1.8.0; extra == "rag"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: requires-python

# Code Quality Intelligence Agent

The Code Quality Intelligence Agent is an enterprise-grade tool that combines traditional static analysis with modern AI capabilities to provide comprehensive code quality assessment. The system integrates multiple analysis engines, semantic search capabilities, and conversational AI to deliver actionable insights for software development teams.


Links:
- PyPI package: [`code-quality-intelligence` 1.6.0](https://pypi.org/project/code-quality-intelligence/1.6.0/)
- Source repository: [Code-Quality-Intelligence-Agent](https://github.com/suvraadeep/Code-Quality-Intelligence-Agent.git)

## 1) Environment and Installation

```bash
# 1. Create and activate a virtual environment (Windows PowerShell)
python -m venv .venv
.\.venv\Scripts\Activate.ps1

#    macOS/Linux
python3 -m venv .venv
source .venv/bin/activate

# 2. Install the package
pip install -U pip
pip install code-quality-intelligence

# Optional: feature extras
pip install "code-quality-intelligence[rag]"    # RAG/semantic search extras
pip install "code-quality-intelligence[full]"   # Web/visualization extras
```

Verify installation and entry points:
```bash
cqi --help | cat
code-quality --help | cat
python -m code_quality_agent --help | cat
```

## 2) Quick Start (CLI)

```bash
# Analyze a local project
cqi analyze . --format console

# JSON report
cqi analyze . --format json --output quality.json

# Markdown report
cqi analyze . --format markdown --output quality.md

# Analyze a GitHub repository
cqi analyze https://github.com/pallets/flask

# Choose a branch
cqi analyze https://github.com/user/repo --branch main

# Interactive Q&A post-analysis
cqi analyze . --interactive
```

The `code-quality` and `code-quality-agent` commands are equivalent entry points.

## 3) Web Interface (Streamlit UI)

The package exposes a full web UI shipped in the repo. To run it from your environment:

```bash
# Install web dependencies
pip install streamlit pandas plotly

# If you cloned the repo, you can run the included web app
cd Webpage
pip install -r requirements.txt
streamlit run app.py
```

Alternatively, create your own minimal Streamlit launcher that calls the CLI under the hood.

Access via http://localhost:8501. Pages: Home, Setup, Info, Analyze, Chat.

## 4) Configuration and API Keys

Basic/static analysis works offline. To enable AI-enhanced and chat/RAG features, configure the Groq API key.

```bash
# A) Environment variable
setx GROQ_API_KEY "your_key_here"           # Windows (restart shell)
export GROQ_API_KEY="your_key_here"        # macOS/Linux

# B) .env file in your project directory
echo GROQ_API_KEY=your_key_here > .env

# C) Setup wizard
cqi setup

# D) Per-command override
cqi analyze . --groq-key your_key_here
```

## 5) What It Does — A→Z Workflow

When you run `cqi analyze`:
1. Input resolution (local path or GitHub URL; optional `--branch`).
2. File discovery and language detection via `FileHandler`.
3. Static analysis: Bandit (security), Radon (complexity), pattern checks.
4. Issue aggregation by severity and category.
5. Optional RAG indexing: embeddings with FAISS/Chroma for semantic Q&A.
6. Report generation: console, JSON, or Markdown.
7. Optional interactive chat: LLM-backed answers grounded in analysis results and RAG retrieval.

Key components (package modules): `code_quality_agent.agent`, `analyzers`, `rag_system` and simple fallback RAG modules, `report_generator`, `cli`.

## 6) CLI Reference

- `cqi analyze PATH [--format console|json|markdown] [--output FILE] [--interactive] [--groq-key KEY] [--branch BRANCH]`
- `cqi info PATH` — quick stats without full analysis
- `cqi setup` — store API key to `.env`, check dependencies
- `cqi chat` — enhanced interactive chat (prompts for a path/URL)
- `cqi dashboard` — launches a demo dashboard

Module mode equivalents:
```bash
python -m code_quality_agent --version
python -m code_quality_agent analyze . --format console
python -m code_quality_agent analyze . --interactive
```

## 7) Features

- Security (Bandit), complexity (Radon), best-practice detection
- GitHub analysis with branch support
- Multi-language coverage (Python, JS/TS, Java, C/C++, C#, Go, Rust, PHP, Ruby, Swift, Kotlin, Scala)
- RAG-enhanced chat and answers; offline heuristic fallback
- Reports: Console, JSON, Markdown
- Streamlit web UI with charts, tables, and setup checks
- Clear error handling and robust CLI UX

## 8) Troubleshooting

- GROQ_API_KEY not found → `cqi setup` or set env/`.env`.
- No supported files → verify path; run `cqi info <path>`.
- RAG not available → install extras: `pip install "code-quality-intelligence[rag]"`.
- GitHub cloning issues → ensure Git is installed and URL/branch are correct.

## 9) CI/CD Example

```yaml
name: Code Quality Assessment
on: [push, pull_request]
jobs:
  quality_check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Setup Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.11'
      - name: Install Code Quality Agent
        run: pip install code-quality-intelligence
      - name: Run Analysis
        run: cqi analyze . --format json --output quality_report.json
        env:
          GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
      - name: Upload Report
        uses: actions/upload-artifact@v3
        with:
          name: quality-report
          path: quality_report.json
```

## 10) License

MIT License. See the source repository for details.

## 11) References

- PyPI: [`code-quality-intelligence` 1.6.0](https://pypi.org/project/code-quality-intelligence/1.6.0/)
- GitHub: [Code-Quality-Intelligence-Agent](https://github.com/suvraadeep/Code-Quality-Intelligence-Agent.git)


