AI-powered code quality analysis tool with GitHub integration and interactive chatbot
Project description
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-intelligence1.6.0 - Source repository: Code-Quality-Intelligence-Agent
1) Environment and Installation
# 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:
cqi --help | cat
code-quality --help | cat
python -m code_quality_agent --help | cat
2) Quick Start (CLI)
# 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:
# 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.
# 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:
- Input resolution (local path or GitHub URL; optional
--branch). - File discovery and language detection via
FileHandler. - Static analysis: Bandit (security), Radon (complexity), pattern checks.
- Issue aggregation by severity and category.
- Optional RAG indexing: embeddings with FAISS/Chroma for semantic Q&A.
- Report generation: console, JSON, or Markdown.
- 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 analysiscqi setup— store API key to.env, check dependenciescqi chat— enhanced interactive chat (prompts for a path/URL)cqi dashboard— launches a demo dashboard
Module mode equivalents:
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 setupor 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
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file code_quality_intelligence-1.6.2.tar.gz.
File metadata
- Download URL: code_quality_intelligence-1.6.2.tar.gz
- Upload date:
- Size: 63.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81df62d09ba80870bf1088f9d400e31b54cc79124ba0770dcddae6714adf0406
|
|
| MD5 |
45944605b2e48b3c34b86fdf95ad340f
|
|
| BLAKE2b-256 |
b10da96de284462b37e3e8b48d2a2023484f3807e08ec3463fe18e84de7f3a15
|
File details
Details for the file code_quality_intelligence-1.6.2-py3-none-any.whl.
File metadata
- Download URL: code_quality_intelligence-1.6.2-py3-none-any.whl
- Upload date:
- Size: 51.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2dfa894fbac7564d5d00d427d4a66c340eeaf526d29132505784853cc1211f14
|
|
| MD5 |
91f5918ccf9e8aafaa05fbeaaeb2b193
|
|
| BLAKE2b-256 |
a0916aa7cd00644058297f6e96cae6c495fa9ace97c73cbf41377ed397f77903
|